~juju-qa/ubuntu/yakkety/juju/juju-1.25.8

« back to all changes in this revision

Viewing changes to src/github.com/juju/utils/clock/wall.go

  • Committer: Nicholas Skaggs
  • Date: 2016-12-02 17:28:37 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161202172837-jkrbdlyjcxtrii2n
Initial commit of 1.25.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2015 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package clock
 
5
 
 
6
import (
 
7
        "time"
 
8
)
 
9
 
 
10
// WallClock exposes wall-clock time via the Clock interface.
 
11
var WallClock wallClock
 
12
 
 
13
// WallClock exposes wall-clock time as returned by time.Now.
 
14
type wallClock struct{}
 
15
 
 
16
// Now is part of the Clock interface.
 
17
func (wallClock) Now() time.Time {
 
18
        return time.Now()
 
19
}
 
20
 
 
21
// Alarm returns a channel that will send a value at some point after
 
22
// the supplied time.
 
23
func (wallClock) After(d time.Duration) <-chan time.Time {
 
24
        return time.After(d)
 
25
}