Skip to content

Reset the timer store

This operation discards every accumulated timer entry in a single call. It is the library's only explicit cleanup path for the process-wide static dictionary that backs all timing state, and it makes no distinction between a timer that finished cleanly and one that was still running.

Field Value
Operation ID CT-OP-003
Trigger Caller invokes CodeTimer.Reset()
Inputs None
Outputs Empty static timer dictionary
Primary components CodeTimer.Reset
Entry point SAIF.Framework.CodeTimer\SAIF.Framework.CodeTimer\CodeTimer.cs

Steps

  1. Invoke data.Clear() on the static timer dictionary that every other operation reads from and writes to.
  2. Remove every tracked CodeTimerEntry, including any entry whose running flag was still true at the moment reset was called — the clear happens unconditionally, with no check of entry state beforehand.
  3. Return control to the caller without producing any result payload; there is nothing for the caller to inspect afterward beyond the fact that subsequent lookups against the dictionary will find no entries.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Reset request]) --> Clear[Clear static timer dictionary]
    Clear --> EndOk([All timer entries removed])

Failure and edge-case behavior

  • Reset() performs no validation of whether any timer is still running before clearing the store, so an in-flight Start/Stop pair on another thread could lose its entry mid-measurement.
  • Reset() returns no confirmation object or count of entries removed; a caller can only infer success by observing that a subsequent Start creates a fresh entry rather than resuming an old one.

Sources

  • SAIF.Framework.CodeTimer\SAIF.Framework.CodeTimer\CodeTimer.cs