Class SnippetPerformanceCounter
Measures execution time and hit count for code snippets during performance testing, optionally logging start and end events.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Spreadsheet.Utilities.Performance
Assembly: Telerik.Windows.Documents.Spreadsheet.dll
Syntax
public class SnippetPerformanceCounter
Constructors
SnippetPerformanceCounter(String, Boolean)
Initializes a new performance counter with the specified snippet name, optionally enabling debug logging for start and end events.
Declaration
public SnippetPerformanceCounter(string snippetName, bool useLogging = true)
Parameters
|
System.String
snippetName
Name of the snippet. |
|
System.Boolean
useLogging
The value indicating whether logging should be used. |
Properties
HitCounter
Number of times Start was called since the last Reset, incremented on each measurement.
Declaration
public int HitCounter { get; }
Property Value
|
System.Int32
The hit counter. |
TotalMilliseconds
Cumulative milliseconds elapsed between all Start/Stop pairs since the last Reset.
Declaration
public double TotalMilliseconds { get; }
Property Value
|
System.Double
The total milliseconds. |
Methods
End()
Stops the current interval if running and logs the final accumulated time and hit count.
Declaration
public void End()
Reset()
Resets all accumulated time, hit count, and state flags to prepare for a new measurement session.
Declaration
public void Reset()
Start()
Starts a measurement interval, recording the current time and incrementing the hit counter; logs on first call.
Declaration
public void Start()
Stop()
Stops the current measurement interval and accumulates its elapsed time into TotalMilliseconds.
Declaration
public void Stop()