shortcut for last update time
This commit is contained in:
parent
f87da2b041
commit
8ecc16f938
7
main.go
7
main.go
|
@ -1,6 +1,8 @@
|
||||||
package zoopb
|
package zoopb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,3 +19,8 @@ func InitMachine() *Machine {
|
||||||
|
|
||||||
return machine
|
return machine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Machine) SinceLastUpdate() time.Duration {
|
||||||
|
age := m.Laststamp.AsTime()
|
||||||
|
return time.Since(age)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue