manualclock

package
v0.0.0-...-c7d92bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package manualclock provides a clock that only advances when explicitly told to.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() clocks.Clock

New returns a manual clock instance set to the current time.

Types

type Ticker

type Ticker event

Ticker represents a "ticker" similar to time.Ticker, except it is controlled by a manual clock.

func (*Ticker) C

func (t *Ticker) C() <-chan time.Time

C returns the tick channel

func (*Ticker) Stop

func (t *Ticker) Stop()

Stop turns off the ticker.

type Timer

type Timer event

Timer represents an event timer similar to time.Timer, except it is controlled by a manual clock.

func (*Timer) C

func (t *Timer) C() <-chan time.Time

C returns the timer-expiry channel

func (*Timer) Reset

func (t *Timer) Reset(d time.Duration) bool

Reset changes the expiry time of the timer, and reactivates it if it was stopped.

func (*Timer) Stop

func (t *Timer) Stop() bool

Stop turns off the timer.

Source Files

  • events.go
  • manualclock.go
  • wait.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL