Table of Contents

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

diagnoser PerformanceDiagnoser

The diagnoser that receives the result.

name string

The 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

PerfCounter

Methods

Dispose()

Ends the measurement and records the elapsed milliseconds in the diagnoser if it is enabled. Does nothing for Default.

public void Dispose()