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

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: Added coverage files. 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
14 // library. Another clock, FakeClock, is available to simulate time facilities
15 // for testing.
16 type Clock interface {
17 Now() time.Time // Returns the current time (see t ime.Now).
18 Sleep(time.Duration) // Sleeps the current goroutine (s ee time.Sleep)
19 NewTimer() Timer // Creates a new Timer instance.
20 After(time.Duration) <-chan time.Time // Waits a duration, then sends th e current time.
21 }
OLDNEW
« no previous file with comments | « go/src/infra/gae/libs/wrapper/wrapper.infra_testing ('k') | go/src/infra/libs/clock/clock.infra_testing » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698