/// <summary> /// Creates a new instance of the timing callback object. /// </summary> /// <param name="counter">an associated counter name</param> /// <param name="callback">a callback that shall be called when endTiming is called.</param> public Timing(string counter, ITimingCallback callback) { _counter = counter; _callback = callback; _start = DateTime.UtcNow.Ticks; }
/// <summary> /// Creates instance of timing object that calculates elapsed time /// and stores it to specified performance counters component under specified name. /// </summary> /// <param name="counter">a name of the counter to record elapsed time interval.</param> /// <param name="callback">a performance counters component to store calculated value.</param> public Timing(string counter, ITimingCallback callback) { _counter = counter; _callback = callback; _start = Environment.TickCount; }