forked from TrueCloudLab/rclone
Tardigrade Backend: Dependencies
This commit is contained in:
parent
962fbc8257
commit
03b629064a
544 changed files with 86690 additions and 2 deletions
27
vendor/github.com/spacemonkeygo/monkit/v3/monotime/monotime_windows.go
generated
vendored
Normal file
27
vendor/github.com/spacemonkeygo/monkit/v3/monotime/monotime_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
package monotime
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"time"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var (
|
||||
modkernel32 = syscall.NewLazyDLL("kernel32.dll")
|
||||
queryPerformanceFrequencyProc = modkernel32.NewProc("QueryPerformanceFrequency")
|
||||
queryPerformanceCounterProc = modkernel32.NewProc("QueryPerformanceCounter")
|
||||
|
||||
qpcFrequency = queryPerformanceFrequency()
|
||||
)
|
||||
|
||||
func elapsed() time.Duration {
|
||||
var elapsed int64
|
||||
syscall.Syscall(queryPerformanceCounterProc.Addr(), 1, uintptr(unsafe.Pointer(&elapsed)), 0, 0)
|
||||
return time.Duration(elapsed) * time.Second / (time.Duration(qpcFrequency) * time.Nanosecond)
|
||||
}
|
||||
|
||||
func queryPerformanceFrequency() int64 {
|
||||
var freq int64
|
||||
syscall.Syscall(queryPerformanceFrequencyProc.Addr(), 1, uintptr(unsafe.Pointer(&freq)), 0, 0)
|
||||
return freq
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue