Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: common/clock/external.go

Issue 2134673003: milo: buildbucket builer view (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebased and regenerated expectations Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/gaeauth/client/client.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/clock/external.go
diff --git a/common/clock/external.go b/common/clock/external.go
index 35ad09c07da1675438428dd45c679bd182bb984c..781492a9d77adf22e12f62416078fb150982b31d 100644
--- a/common/clock/external.go
+++ b/common/clock/external.go
@@ -60,3 +60,8 @@ func NewTimer(ctx context.Context) Timer {
func After(ctx context.Context, d time.Duration) <-chan TimerResult {
return Get(ctx).After(ctx, d)
}
+
+// Since is an equivalent of time.Since.
+func Since(ctx context.Context, t time.Time) time.Duration {
+ return Now(ctx).Sub(t)
+}
« no previous file with comments | « appengine/gaeauth/client/client.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698