time

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package time extends the time package in the stdlib.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	// Now tells the actual time.
	Now() time.Time
}

Clock tells the time.

func NewClock

func NewClock() Clock

NewClock returns a new running clock.

func NewStoppedClock

func NewStoppedClock(t time.Time) Clock

NewStoppedClock returns a new StoppedClock.

type RunningClock

type RunningClock struct{}

RunningClock shows the current time.

func (*RunningClock) Now

func (c *RunningClock) Now() time.Time

Now tells the current time.

type StoppedClock

type StoppedClock struct {
	// contains filtered or unexported fields
}

StoppedClock shows the moment it has been stopped.

func (*StoppedClock) Now

func (c *StoppedClock) Now() time.Time

Now tells the time when it has been stopped.

Jump to

Keyboard shortcuts

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