The value produced for the EvFrequency event on Windows is missing the
fact that the cputicks clock gets divided. This results in durations
that are consistently wrong by the same factor (about 256).
Fixes #65997.
Change-Id: I930cbfce3499d435c20699f41c11e3227d84f911
Reviewed-on: https://go-review.googlesource.com/c/go/+/567937
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
func traceClockUnitsPerSecond() uint64 {
if osHasLowResClock {
// We're using cputicks as our clock, so we need a real estimate.
- return uint64(ticksPerSecond())
+ return uint64(ticksPerSecond() / traceTimeDiv)
}
// Our clock is nanotime, so it's just the constant time division.
// (trace clock units / nanoseconds) * (1e9 nanoseconds / 1 second)