clock

package
v0.25.5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 3 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 aliases the quartz Clock and adds Real, Or and Wait. Code that takes a Clock waits on it, and a test passes a quartz Mock to make that wait take no wall time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait

func Wait(ctx context.Context, c Clock, d time.Duration) error

Wait blocks for d on c. It returns the error of ctx when ctx ends first.

Types

type Clock

type Clock = quartz.Clock

Clock reads time and starts timers and tickers.

func Or

func Or(c Clock) Clock

Or returns c, or the real clock when c is nil.

func Real

func Real() Clock

Real returns the clock that follows wall time.

Jump to

Keyboard shortcuts

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