Struct PerfCounter
- Namespace
- Utils.Common
- Assembly
- Utils.Common.dll
A measurement started by Measure(string): the time between its creation and
Dispose() is recorded under its name. Use it in a using statement.
public readonly ref struct PerfCounter
Constructors
PerfCounter(PerformanceDiagnoser, string)
Starts a measurement now.
public PerfCounter(PerformanceDiagnoser diagnoser, string name)
Parameters
diagnoserPerformanceDiagnoserThe diagnoser that receives the result.
namestringThe name the duration is recorded under.
Properties
Default
An empty measurement that records nothing, for when no diagnoser is available.
public static PerfCounter Default { get; }
Property Value
Methods
Dispose()
Ends the measurement and records the elapsed milliseconds in the diagnoser if it is enabled. Does nothing for Default.
public void Dispose()