aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/aristanetworks/goarista/monotime
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-02-16 20:21:11 +0800
committerFelix Lange <fjl@twurst.com>2017-02-16 20:44:09 +0800
commit2c4455b12aca82ccd29c05c1750c25430867e545 (patch)
tree0beb8c96c7bf6a5a82434ed79218e822927434c3 /vendor/github.com/aristanetworks/goarista/monotime
parentc8695fae359aa327da9203a57ffaf4f2d47d4370 (diff)
downloadgo-tangerine-2c4455b12aca82ccd29c05c1750c25430867e545.tar.gz
go-tangerine-2c4455b12aca82ccd29c05c1750c25430867e545.tar.zst
go-tangerine-2c4455b12aca82ccd29c05c1750c25430867e545.zip
vendor: update dependencies with github.com/kardianos/govendor
Diffstat (limited to 'vendor/github.com/aristanetworks/goarista/monotime')
-rw-r--r--vendor/github.com/aristanetworks/goarista/monotime/nanotime.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/github.com/aristanetworks/goarista/monotime/nanotime.go b/vendor/github.com/aristanetworks/goarista/monotime/nanotime.go
index efc1b92a6..5f5fbc7ae 100644
--- a/vendor/github.com/aristanetworks/goarista/monotime/nanotime.go
+++ b/vendor/github.com/aristanetworks/goarista/monotime/nanotime.go
@@ -6,6 +6,7 @@
package monotime
import (
+ "time"
_ "unsafe" // required to use //go:linkname
)
@@ -22,3 +23,9 @@ func nanotime() int64
func Now() uint64 {
return uint64(nanotime())
}
+
+// Since returns the amount of time that has elapsed since t. t should be
+// the result of a call to Now() on the same machine.
+func Since(t uint64) time.Duration {
+ return time.Duration(Now() - t)
+}