clock: code.cloudfoundry.org/clock Index | Files | Directories

package clock

import "code.cloudfoundry.org/clock"

Index

Package Files

clock.go package.go ticker.go timer.go

type Clock Uses

type Clock interface {
    Now() time.Time
    Sleep(d time.Duration)
    Since(t time.Time) time.Duration
    // After waits for the duration to elapse and then sends the current time
    // on the returned channel.
    // It is equivalent to clock.NewTimer(d).C.
    // The underlying Timer is not recovered by the garbage collector
    // until the timer fires. If efficiency is a concern, use clock.NewTimer
    // instead and call Timer.Stop if the timer is no longer needed.
    After(d time.Duration) <-chan time.Time

    NewTimer(d time.Duration) Timer
    NewTicker(d time.Duration) Ticker
}

func NewClock Uses

func NewClock() Clock

type Ticker Uses

type Ticker interface {
    C() <-chan time.Time
    Stop()
}

type Timer Uses

type Timer interface {
    C() <-chan time.Time
    Reset(d time.Duration) bool
    Stop() bool
}

Directories

PathSynopsis
fakeclock

Package clock imports 1 packages (graph) and is imported by 371 packages. Updated 2019-05-29. Refresh now. Tools for package owners.