| OLD | NEW |
| (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 } | |
| OLD | NEW |