clock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package clock supplies wall time and deterministic timers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
	After(time.Duration) <-chan time.Time
}

type Fake

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

func NewFake

func NewFake(start time.Time) *Fake

func (*Fake) Advance

func (f *Fake) Advance(d time.Duration)

Advance delivers due timers without blocking on their consumers.

func (*Fake) After

func (f *Fake) After(d time.Duration) <-chan time.Time

func (*Fake) BlockUntil

func (f *Fake) BlockUntil(n int)

BlockUntil waits until n pending timers have been registered.

func (*Fake) Now

func (f *Fake) Now() time.Time

type Real

type Real struct{}

func (Real) After

func (Real) After(d time.Duration) <-chan time.Time

func (Real) Now

func (Real) Now() time.Time

Jump to

Keyboard shortcuts

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