C# Class WebApplications.Utilities.Performance.PerformanceCounterExtensions

Mostra file Open project: webappsuk/CoreLibraries

Public Methods

Method Description
GetElapsedTime ( CounterSample oldSample, CounterSample newSample ) : System.Duration

Gets the elapsed time between two samples

SafeNextValue ( [ counter ) : float

Safely gets the next value of a performance counter, by ensuring that a minimum duration has passed since the last next value was requested.

Method Details

GetElapsedTime() public static method

Gets the elapsed time between two samples
public static GetElapsedTime ( CounterSample oldSample, CounterSample newSample ) : System.Duration
oldSample System.Diagnostics.CounterSample The old sample.
newSample System.Diagnostics.CounterSample The new sample.
return System.Duration

SafeNextValue() public static method

Safely gets the next value of a performance counter, by ensuring that a minimum duration has passed since the last next value was requested.
public static SafeNextValue ( [ counter ) : float
counter [ The counter.
return float