Source file src/testing/testing_other.go
1 // Copyright 2021 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !windows 6 7 package testing 8 9 import "time" 10 11 // isWindowsRetryable reports whether err is a Windows error code 12 // that may be fixed by retrying a failed filesystem operation. 13 func isWindowsRetryable(err error) bool { 14 return false 15 } 16 17 // highPrecisionTime represents a single point in time. 18 // On all systems except Windows, using time.Time is fine. 19 type highPrecisionTime struct { 20 now time.Time 21 } 22 23 // highPrecisionTimeNow returns high precision time for benchmarking. 24 func highPrecisionTimeNow() highPrecisionTime { 25 return highPrecisionTime{now: time.Now()} 26 } 27 28 // highPrecisionTimeSince returns duration since b. 29 func highPrecisionTimeSince(b highPrecisionTime) time.Duration { 30 return time.Since(b.now) 31 } 32