clock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 1 Imported by: ? 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 is the one place that reads the wall clock for the data that semaphore stamps, compares or evaluates against (evaluation dates, event creation dates, cache refresh dates, rate-limit windows, token lifetimes, log timestamps).

It is a leaf package so that every package can import it without a cycle.

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Now

Now returns the current time. It is time.Now unless a test package replaced it in its TestMain (see the clocktest package): production code must not assign it.

It is the only package-level variable that semaphore allows, on purpose: the alternative is to thread a clock through every constructor, evaluation and log call for the benefit of tests. Measured durations (time.Since, deadlines of network connections, retry back-offs) do not go through it: they need the real clock.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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