Commit 13d5edde authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 20b124bb
......@@ -24,13 +24,15 @@ import (
"time"
)
// Mono returns monotonically increasing time.
// It uses monotonic time for measurements and is robust to OS clock adjustments
// Mono returns time passed since program start.
//
// It uses monotonic time for measurements and is robust to OS clock adjustments.
//
// XXX better return time.Duration?
func Mono() float64 {
// time.Sub uses monotonic clock readings for the difference
return time.Now().Sub(epoch).Seconds()
// FIXME py returns it since epoch, not since start
return time.Now().Sub(tstart).Seconds()
}
var epoch time.Time // zero value is epoch
var tstart time.Time = time.Now()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment