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

Side by Side Diff: go/src/infra/libs/clock/clock.go

Issue 1154213012: Add context-aware "time" library wrapper. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Removed goroutine safety from testtimer. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package clock
6
7 import (
8 "time"
9 )
10
11 // A Clock is an interface to system time.
12 //
13 // The standard clock is SystemClock, which falls through to the system time lib rary.
14 // Another clock, FakeClock, is available to simulate time facilities for testin g.
15 type Clock interface {
16 Now() time.Time // Returns the current time (see t ime.Now).
17 Sleep(time.Duration) // Sleeps the current goroutine (s ee time.Sleep)
18 NewTimer() Timer // Creates a new Timer instance.
19 After(time.Duration) <-chan time.Time // Waits a duration, then sends th e current time.
20 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698