Table of Contents

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

operationName string

The name of the operation being timed.

metrics IUnifiedPerformanceMetrics

Optional metrics provider for recording results.

Properties

Elapsed

Gets the elapsed time.

public TimeSpan Elapsed { get; }

Property Value

TimeSpan

ElapsedMilliseconds

Gets the elapsed time in milliseconds.

public double ElapsedMilliseconds { get; }

Property Value

double

OperationName

Gets the operation name being measured.

public string OperationName { get; }

Property Value

string

Methods

Dispose()

Stops the timer and optionally records metrics.

public void Dispose()