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.
파일 보기 프로젝트 열기: azavea/net-om-utils-common

공개 메소드들

메소드 설명
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