github.com/loov/hrtime@v1.0.3/now_other.go (about) 1 // +build !windows 2 3 package hrtime 4 5 import "time" 6 7 // Now returns current time.Duration with best possible precision. 8 // 9 // Now returns time offset from a specific time. 10 // The values aren't comparable between computer restarts or between computers. 11 func Now() time.Duration { 12 return time.Duration(time.Now().UnixNano()) * time.Nanosecond 13 } 14 15 // NowPrecision returns maximum possible precision for Nanos in nanoseconds. 16 func NowPrecision() float64 { return float64(1) }