- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for highPrecisionTimeNow (0.26 sec)
-
src/testing/export_test.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package testing var PrettyPrint = prettyPrint type HighPrecisionTime = highPrecisionTime
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 26 22:55:25 UTC 2024 - 300 bytes - Viewed (0) -
src/testing/testing_windows.go
// // TODO: If Windows runtime implements high resolution timing then highPrecisionTime // can be removed. type highPrecisionTime struct { now int64 } // highPrecisionTimeNow returns high precision time for benchmarking. func highPrecisionTimeNow() highPrecisionTime { var t highPrecisionTime // This should always succeed for Windows XP and above. t.now = windows.QueryPerformanceCounter() return t }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 26 22:55:25 UTC 2024 - 1.9K bytes - Viewed (0) -
src/testing/testing_other.go
} // highPrecisionTime represents a single point in time. // On all systems except Windows, using time.Time is fine. type highPrecisionTime struct { now time.Time } // highPrecisionTimeNow returns high precision time for benchmarking. func highPrecisionTimeNow() highPrecisionTime { return highPrecisionTime{now: time.Now()} } // highPrecisionTimeSince returns duration since b.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Apr 27 19:42:36 UTC 2024 - 876 bytes - Viewed (0) -
src/testing/testing_windows_test.go
func BenchmarkTimeNow(b *testing.B) { for i := 0; i < b.N; i++ { sink = time.Now() } } func BenchmarkHighPrecisionTimeNow(b *testing.B) { for i := 0; i < b.N; i++ { sinkHPT = testing.HighPrecisionTimeNow() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 26 22:55:25 UTC 2024 - 490 bytes - Viewed (0) -
src/testing/benchmark.go
// a call to [B.StopTimer]. func (b *B) StartTimer() { if !b.timerOn { runtime.ReadMemStats(&memStats) b.startAllocs = memStats.Mallocs b.startBytes = memStats.TotalAlloc b.start = highPrecisionTimeNow() b.timerOn = true } } // StopTimer stops timing a test. This can be used to pause the timer // while performing complex initialization that you don't // want to measure.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 23.9K bytes - Viewed (0) -
src/testing/fuzz.go
f.testContext.release() close(f.barrier) // Wait for the subtests to complete. for _, sub := range f.sub { <-sub.signal } cleanupStart := highPrecisionTimeNow() err := f.runCleanup(recoverAndReturnPanic) f.duration += highPrecisionTimeSince(cleanupStart) if err != nil { doPanic(err) } } // Report after all subtests have finished.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 26 22:55:25 UTC 2024 - 22.9K bytes - Viewed (0) -
src/testing/testing.go
t.context.waitParallel() if t.chatty != nil { t.chatty.Updatef(t.name, "=== CONT %s\n", t.name) } running.Store(t.name, highPrecisionTimeNow()) t.start = highPrecisionTimeNow() // Reset the local race counter to ignore any races that happened while this // goroutine was blocked, such as in the parent test or in other parallel // subtests. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 76.1K bytes - Viewed (0)