C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Public Static Functions
Profiler Class Reference

The Profiler class is used to benchmark code segments.

Public Static Functions

static ProfiledEvent Begin (string eventName)
 
static TimeSpan GetAverage (string eventName)
 
static int GetCount (string eventName)
 
static TimeSpan GetLastValue (string eventName)
 
static double GetTimeAverage (string eventName)
 
static TimeSpan GetTotal (string eventName)
 
static void Record (string eventName, TimeSpan elapsed)
 
static void Record (string eventName, double val)
 

Usage Description

static ProfiledEvent Begin ( string  eventName)
inlinestatic

Creates a new profiled event. The name that you choose for the eventName is the name that will appear in the profiler report.

static TimeSpan GetAverage ( string  eventName)
inlinestatic

Returns the moving average for this event profiler. The moving average window is 100 events.

static int GetCount ( string  eventName)
inlinestatic

Returns the number of events recorded to this event profiler.

static TimeSpan GetLastValue ( string  eventName)
inlinestatic

Returns the last time span recorded to this event profiler.

static double GetTimeAverage ( string  eventName)
inlinestatic

Returns the average time of the TimeSpan events in the moving average window (difference between last timespan and first, divided by the total duration of recorded timespans in the moving average window).

static TimeSpan GetTotal ( string  eventName)
inlinestatic

Returns the total length of all TimeSpan events recorded into this profiler.

static void Record ( string  eventName,
TimeSpan  elapsed 
)
inlinestatic

Records the provided TimeSpan into a profiled event. This timespan will be added to the moving average, total average, and total length. This value will also be maintained as the last value in the profiler until record is called again.

static void Record ( string  eventName,
double  val 
)
inlinestatic

Records a timespan of the provided length into a profiled event. This timespan will be added to the moving average, total average, and total length. This value will also be maintained as the last value in the profiler until record is called again.