Interface ITimerHandle
- Namespace
- DotCompute.Abstractions.Interfaces.Telemetry
- Assembly
- DotCompute.Abstractions.dll
Handle for controlling an active timing operation.
public interface ITimerHandle : IDisposable
- Inherited Members
- Extension Methods
Properties
Elapsed
Gets the elapsed time since the operation started.
TimeSpan Elapsed { get; }
Property Value
OperationId
Gets the unique identifier for this operation instance.
string OperationId { get; }
Property Value
OperationName
Gets the name of the operation being timed.
string OperationName { get; }
Property Value
StartTime
Gets the time when the operation started.
DateTime StartTime { get; }
Property Value
Methods
AddCheckpoint(string)
Adds a checkpoint with a name and the current elapsed time.
TimeSpan AddCheckpoint(string checkpointName)
Parameters
checkpointNamestringName of the checkpoint
Returns
- TimeSpan
Elapsed time at the checkpoint
GetCheckpoints()
Gets all checkpoints recorded for this operation.
IDictionary<string, TimeSpan> GetCheckpoints()
Returns
- IDictionary<string, TimeSpan>
Dictionary mapping checkpoint names to their elapsed times
StopTimer(IDictionary<string, object>?)
Stops the timer and records the operation duration.
TimeSpan StopTimer(IDictionary<string, object>? metadata = null)
Parameters
metadataIDictionary<string, object>Optional metadata to associate with the timing record
Returns
- TimeSpan
The total duration of the operation