Table of Contents

Method RegisterTimeOfDay

Namespace
KZDev.SystemClock.PrimeTime.Testing
Assembly
KZDev.SystemClock.PrimeTime.Testing.dll

RegisterTimeOfDay(LocalTimeOfDay, Action<ClockTimerCallbackContext>, CancellationToken, object?, DayTimeTimerOptions?)

Registers a local time-of-day timer with a synchronous callback that receives timer context and optional state. Other RegisterTimeOfDay overloads for LocalTimeOfDay are provided as extension methods.

public IClockDayTimeTimer RegisterTimeOfDay(LocalTimeOfDay timeOfDay, Action<ClockTimerCallbackContext> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)

Parameters

timeOfDay LocalTimeOfDay

The local time of day at which to fire.

callback Action<ClockTimerCallbackContext>

The callback invoked when the timer fires; receives timer context.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration; pass None when no external cancellation is required.

state object

Optional state passed to the callback via ClockTimerCallbackContext.

timerOptions DayTimeTimerOptions

Optional day-time timer options.

Returns

IClockDayTimeTimer

An IClockDayTimeTimer to monitor or change the timer.

Remarks

Only supported in .NET 8+. Not supported in NetStandard 2.0.

RegisterTimeOfDay(UtcTimeOfDay, Action<ClockTimerCallbackContext>, CancellationToken, object?, DayTimeTimerOptions?)

Registers a UTC time-of-day timer with a synchronous callback that receives timer context and optional state. Other RegisterTimeOfDay overloads for UtcTimeOfDay are provided as extension methods.

public IClockDayTimeTimer RegisterTimeOfDay(UtcTimeOfDay timeOfDay, Action<ClockTimerCallbackContext> callback, CancellationToken cancellationToken, object? state = null, DayTimeTimerOptions? timerOptions = null)

Parameters

timeOfDay UtcTimeOfDay

The UTC time of day at which to fire.

callback Action<ClockTimerCallbackContext>

The callback invoked when the timer fires; receives timer context.

cancellationToken CancellationToken

Token that participates in cancelling the timer registration; pass None when no external cancellation is required.

state object

Optional state passed to the callback via ClockTimerCallbackContext.

timerOptions DayTimeTimerOptions

Optional day-time timer options.

Returns

IClockDayTimeTimer

An IClockDayTimeTimer to monitor or change the timer.

Remarks

Only supported in .NET 8+. Not supported in NetStandard 2.0.