stash/vendor/github.com/knq/sysutil/sysutil_windows.go
bnkai 4373f9bf01
Add cdp support for xpath scrapers (#625)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-08-04 10:42:40 +10:00

23 lines
395 B
Go

// +build windows
package sysutil
import (
"syscall"
"time"
)
var (
kernel32DLL = syscall.MustLoadDLL("kernel32")
procGetTickCount64 = kernel32DLL.MustFindProc("GetTickCount64")
)
func init() {
res, _, err := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0)
if err != 0 {
btime = time.Now()
return
}
btime = time.Now().Add(time.Duration(-res) * time.Millisecond)
}