wallclock

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

type Timer interface {
	C() <-chan time.Time
	Reset(d time.Duration) bool
	Stop() bool
}

Timer abstracts the functionality of time.Timer.

type WallClock

type WallClock interface {
	WithTimeoutCause(
		parent context.Context,
		timeout time.Duration,
		cause error,
	) (context.Context, context.CancelFunc)
	After(d time.Duration) <-chan time.Time
	NewTimer(d time.Duration) Timer
	Now() time.Time
}

WallClock abstracts a subset of functionality from packages context and time.

var Instance WallClock = wallClock{}

Instance is a WallClock singleton used for indirect time-based references to packages context and time. Test code can set the instance to interpose on functions and control apparent time.

Jump to

Keyboard shortcuts

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