diff options
author | Jordan Rhee <jordanrh@microsoft.com> | 2018-12-18 16:41:57 -0800 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-12-20 00:23:03 +0000 |
commit | 84066f1b0b68761a75ce9064f4c412f751ee2168 (patch) | |
tree | 496281c1451a09846157cf03138b0f1a7b958328 /src/runtime/os_windows_arm.go | |
parent | d0f8a7517ab0b33c8e3dd49294800dd6144e4cee (diff) | |
download | go-84066f1b0b68761a75ce9064f4c412f751ee2168.tar.gz go-84066f1b0b68761a75ce9064f4c412f751ee2168.zip |
runtime: use QPC to implement cputicks() on windows/arm
Tracing uses cputicks() to generate trace event timestamps. cputicks()
is expected to be a high resolution clock source. On Windows/ARM,
call QueryPerformanceCounter() which is the highest resolution clock
source available.
Updates #26148
Change-Id: I987fa556060b3d60c02f07b87b9e6320b9b026e2
Reviewed-on: https://go-review.googlesource.com/c/154762
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/os_windows_arm.go')
-rw-r--r-- | src/runtime/os_windows_arm.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/os_windows_arm.go b/src/runtime/os_windows_arm.go index 3115f7241d..10aff75e31 100644 --- a/src/runtime/os_windows_arm.go +++ b/src/runtime/os_windows_arm.go @@ -4,9 +4,13 @@ package runtime +import "unsafe" + //go:nosplit func cputicks() int64 { - return nanotime() + var counter int64 + stdcall1(_QueryPerformanceCounter, uintptr(unsafe.Pointer(&counter))) + return counter } func checkgoarm() { |