Commit 17072f33 authored by Kirill Smelkov's avatar Kirill Smelkov

X monotime -> xtime

parent 448231d7
......@@ -17,18 +17,18 @@
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
package neo
// time related utilities
// Package xtime complements standard package time.
package xtime
import (
"time"
)
// monotime returns time passed since program start
// it uses monothonic time for measurments and is robust to OS clock adjustments
// Mono returns time passed since program start.
// It uses monothonic time for measurments and is robust to OS clock adjustments
//
// XXX better return time.Duration?
func monotime() float64 {
func Mono() float64 {
// time.Sub uses monotonic clock readings for the difference
return time.Now().Sub(tstart).Seconds()
}
......
......@@ -31,6 +31,7 @@ import (
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/neo/go/neo/internal/xtime"
"lab.nexedi.com/kirr/neo/go/neo/neonet"
"lab.nexedi.com/kirr/neo/go/neo/proto"
"lab.nexedi.com/kirr/neo/go/neo/xneo"
......@@ -82,7 +83,7 @@ func NewMaster(clusterName string, net xnet.Networker) *Master {
nodeCome: make(chan nodeCome),
// nodeLeave: make(chan nodeLeave),
monotime: monotime,
monotime: xtime.Mono,
}
return m
......
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