File: sysutil_windows.go

package info (click to toggle)
golang-github-chromedp-sysutil 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 112 kB
  • sloc: makefile: 5
file content (22 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// +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)
}