static void PrintTimerStatistics(TimekeeperSnapshot snapshot) { Console.WriteLine($"{snapshot.Name} from {snapshot.CaptureStartUtc} to {snapshot.CaptureEndUtc}"); Console.WriteLine($"\tCount: {snapshot.CaptureCount}"); Console.WriteLine($"\tTotal: {snapshot.TotalCaptureSum}"); Console.WriteLine($"\tMax: {snapshot.MaxCaptureDuration}"); Console.WriteLine($"\tAverage: {snapshot.AverageCaptureDuration}"); }
static void PrintTimerStatistics(TimekeeperSnapshot snapshot) { Console.WriteLine($"{snapshot.Name} from {snapshot.CaptureStartUtc} to {snapshot.CaptureEndUtc}"); Console.WriteLine($"\tCount: {snapshot.CaptureCount}"); Console.WriteLine($"\tTotal: {snapshot.TotalCaptureSum}"); Console.WriteLine($"\tMax: {snapshot.MaxCaptureDuration}"); Console.WriteLine($"\tAverage: {snapshot.AverageCaptureDuration}"); }
public TimekeeperSnapshot Snapshot() { lock (_lockObject) { var snapshot = TimerStatistics; TimerStatistics = new TimekeeperSnapshot(Name); snapshot.EndCapture(); return snapshot; } }
internal StopwatchTimekeeper(string name) { Name = name; TimerStatistics = new TimekeeperSnapshot(Name); }