summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-21 19:30:31 -0500
committerJeff Carr <[email protected]>2025-03-22 09:45:49 -0500
commit8ecc16f938a2bacfb4c5a4cb7a212d7b2969f088 (patch)
tree60812e03d8f4a2716f01a6960bfbc377fdfca828
parentf87da2b041b6a1f0464d493e2f1b7fdfc457cf58 (diff)
shortcut for last update timev0.0.48
-rw-r--r--main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.go b/main.go
index c3fc8c6..b066d35 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,8 @@
package zoopb
import (
+ "time"
+
"go.wit.com/log"
)
@@ -17,3 +19,8 @@ func InitMachine() *Machine {
return machine
}
+
+func (m *Machine) SinceLastUpdate() time.Duration {
+ age := m.Laststamp.AsTime()
+ return time.Since(age)
+}