27 #region class variables
29 private ElapsedTimeHandler _elapsedTimeHandler;
30 [NonSerialized]
private Stopwatch _stopwatch;
40 _elapsedTimeHandler = elapsedTimeHandler;
48 _stopwatch = Stopwatch.StartNew();
56 if (_elapsedTimeHandler != null)
95 _stopwatch = stopwatch;
void Dispose()
Calls the client's ElapsedTimeHandler at the closing brace of the using statement. Implemented by calling AcStopWatch::Stop.
delegate void ElapsedTimeHandler(string elapsedTime)
void Start()
Set the stopwatch to zero and begin measuring elapsed time.
Wrapper around TimeSpan so we can return our own formatted elapsed time string and still sort correct...
void Stop()
Call the client's ElapsedTimeHandler with the elapsed time as a formatted string in days...
Makes the using statement available for AcStopWatch objects. Adapted from Profiling with Stopwatch by...
Determine the amount of time a task takes to run.
string ToString(string format, IFormatProvider provider)
The ToString implementation.
AcStopWatchMarker(AcStopWatch stopwatch)
Constructor to initialize and start the stopwatch. Implemented by calling AcStopWatch::Start.
AcStopWatch(ElapsedTimeHandler elapsedTimeHandler)
Constructor that takes an ElapsedTimeHandler.