C# Класс Azavea.Open.Common.Chronometer

A class for timing how long things take. You can instantiate a Chronometer, or just use the static methods for timing named operations.
Показать файл Открыть проект

Открытые методы

Метод Описание
BeginTiming ( StringBuilder keyBuilder ) : void

Starts timing the specified named operation. Each time the same named operation is completed the time will be added to our list, so that a number of calls to the same command will give you totals, average, and number of executions.

BeginTiming ( string key ) : void

Starts timing the specified named operation. Each time the same named operation is completed the time will be added to our list, so that a number of calls to the same command will give you totals, average, and number of executions.

Chronometer ( ) : System

Creates (and starts) the timer.

EndTiming ( StringBuilder keyBuilder ) : long

Stops timing the given item and updates the timing report.

EndTiming ( string key ) : long

Stops timing the given item and updates the timing report.

GetElapsedTime ( ) : string

For display purposes, reports the run time as a long string.

GetRunTime ( ) : System.TimeSpan

How long has the timer been running.

GetSplit ( ) : System.TimeSpan

How long has the timer been running since you last called GetSplit.

GetSplitMilliseconds ( ) : string

For display purposes, reports the split time in milliseconds.

GetSplitSeconds ( ) : string

For display purposes, reports the split time in seconds.

ReportTimes ( ) : void

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.

ReportTimes ( bool extendedStats ) : void

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.

ReportTimes ( bool extendedStats, ReportType reportType ) : void

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.

ReportTimes ( bool extendedStats, ReportType outType, bool printDisclaimer ) : void

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.

Reset ( ) : void

Restarts the timer (same as calling Start() again).

Start ( ) : void

Restarts the timer.

Приватные методы

Метод Описание
ReallyBeginTiming ( string keyWithThread ) : void

Behind the scenes we tack onto the key the name of the thread, in case multiple threads are running the same named operation at the same time.

ReallyEndTiming ( string originalKey, string keyWithThread ) : long

Behind the scenes we tack onto the key the name of the thread, in case multiple threads are running the same named operation at the same time.

Описание методов

BeginTiming() публичный статический Метод

Starts timing the specified named operation. Each time the same named operation is completed the time will be added to our list, so that a number of calls to the same command will give you totals, average, and number of executions.
public static BeginTiming ( StringBuilder keyBuilder ) : void
keyBuilder StringBuilder A StringBuilder containing a string that uniquely /// identifies the operation.
Результат void

BeginTiming() публичный статический Метод

Starts timing the specified named operation. Each time the same named operation is completed the time will be added to our list, so that a number of calls to the same command will give you totals, average, and number of executions.
public static BeginTiming ( string key ) : void
key string A string that uniquely identifies the operation.
Результат void

Chronometer() публичный Метод

Creates (and starts) the timer.
public Chronometer ( ) : System
Результат System

EndTiming() публичный статический Метод

Stops timing the given item and updates the timing report.
public static EndTiming ( StringBuilder keyBuilder ) : long
keyBuilder StringBuilder A StringBuilder containing a string that uniquely /// identifies the operation.
Результат long

EndTiming() публичный статический Метод

Stops timing the given item and updates the timing report.
public static EndTiming ( string key ) : long
key string A string that uniquely identifies the operation.
Результат long

GetElapsedTime() публичный Метод

For display purposes, reports the run time as a long string.
public GetElapsedTime ( ) : string
Результат string

GetRunTime() публичный Метод

How long has the timer been running.
public GetRunTime ( ) : System.TimeSpan
Результат System.TimeSpan

GetSplit() публичный Метод

How long has the timer been running since you last called GetSplit.
public GetSplit ( ) : System.TimeSpan
Результат System.TimeSpan

GetSplitMilliseconds() публичный Метод

For display purposes, reports the split time in milliseconds.
public GetSplitMilliseconds ( ) : string
Результат string

GetSplitSeconds() публичный Метод

For display purposes, reports the split time in seconds.
public GetSplitSeconds ( ) : string
Результат string

ReportTimes() публичный статический Метод

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.
public static ReportTimes ( ) : void
Результат void

ReportTimes() публичный статический Метод

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.
public static ReportTimes ( bool extendedStats ) : void
extendedStats bool Show extended stats: Min, Max, StdDev, Variance.
Результат void

ReportTimes() публичный статический Метод

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.
public static ReportTimes ( bool extendedStats, ReportType reportType ) : void
extendedStats bool Show extended stats: Min, Max, StdDev, Variance.
reportType ReportType Print a disclaimer notice along with the times.
Результат void

ReportTimes() публичный статический Метод

Reports all the times for all the operations that both BeginTiming and EndTiming were called for. This is imperfect as any call that failed may or may not have a time reported. It should, however, give a rough idea what operations are taking how long.
public static ReportTimes ( bool extendedStats, ReportType outType, bool printDisclaimer ) : void
extendedStats bool Show extended stats: Min, Max, StdDev, Variance.
outType ReportType The type of output to report.
printDisclaimer bool Print a disclaimer notice along with the times.
Результат void

Reset() публичный Метод

Restarts the timer (same as calling Start() again).
public Reset ( ) : void
Результат void

Start() публичный Метод

Restarts the timer.
public Start ( ) : void
Результат void