Class PerformanceTimer
- Namespace
- DotCompute.Abstractions.Performance
- Assembly
- DotCompute.Abstractions.dll
High-resolution timer for performance measurements.
public sealed class PerformanceTimer : IDisposable
- Inheritance
-
PerformanceTimer
- Implements
- Inherited Members
- Extension Methods
Constructors
PerformanceTimer(string, IUnifiedPerformanceMetrics?)
Initializes a new instance of the PerformanceTimer class.
public PerformanceTimer(string operationName, IUnifiedPerformanceMetrics? metrics = null)
Parameters
operationNamestringThe name of the operation being timed.
metricsIUnifiedPerformanceMetricsOptional metrics provider for recording results.
Properties
Elapsed
Gets the elapsed time.
public TimeSpan Elapsed { get; }
Property Value
ElapsedMilliseconds
Gets the elapsed time in milliseconds.
public double ElapsedMilliseconds { get; }
Property Value
OperationName
Gets the operation name being measured.
public string OperationName { get; }
Property Value
Methods
Dispose()
Stops the timer and optionally records metrics.
public void Dispose()