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¶
- Invoke
data.Clear()on the static timer dictionary that every other operation reads from and writes to. - Remove every tracked
CodeTimerEntry, including any entry whose running flag was stilltrueat the moment reset was called — the clear happens unconditionally, with no check of entry state beforehand. - 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-flightStart/Stoppair 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 subsequentStartcreates a fresh entry rather than resuming an old one.
Related documentation¶
Sources¶
- SAIF.Framework.CodeTimer\SAIF.Framework.CodeTimer\CodeTimer.cs