Table of Contents

Method Start

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

Start(Duration?)

Starts the deadline-driven automatic runner at the given virtual-time-per-real-second rate.

void Start(Duration? perSecondRate = null)

Parameters

perSecondRate Duration?

Virtual time that elapses per one real second, or null for 1:1.

Remarks

Forwards to Start(TimeSpan?) after converting perSecondRate. See that member for runner semantics, rate bounds, projection, and persist-on-read.

Exceptions

ArgumentOutOfRangeException

Thrown when perSecondRate is not null and its BCL conversion is outside 100 milliseconds to 1 hour of virtual time per real second (inclusive).

Start(TimeSpan?)

Starts a background runner that advances virtual time toward the next delay, time-expiry, timer due instant, or virtual-minute ClockEvents heartbeat, scaled by the run rate.

void Start(TimeSpan? perSecondRate = null)

Parameters

perSecondRate TimeSpan?

Virtual time that elapses per one real second, or null for 1 second of virtual time per real second.

Remarks

When already running, this method has no effect. While running, IsRunning is true, "now" getters project from a committed instant plus a monotonic anchor, and Stop() stops projection and joins the runner thread.

The runner does not use a fixed one-second poll. It computes intended real sleep from the next virtual deadline, skips real sleeps shorter than 15 ms by processing virtual steps in-process, wakes on scheduling changes and persist-on-read, and after a real wait applies virtual elapsed from measured anchor elapsed time (oversleep catch-up).

Exceptions

ArgumentOutOfRangeException

Thrown when perSecondRate is not null and is less than 100 milliseconds or greater than 1 hour of virtual time per real second (no clamping).