Exemple #1
0
 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}");
 }
Exemple #2
0
 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}");
 }
Exemple #3
0
        public TimekeeperSnapshot Snapshot()
        {
            lock (_lockObject)
            {
                var snapshot = TimerStatistics;
                TimerStatistics = new TimekeeperSnapshot(Name);
                snapshot.EndCapture();

                return snapshot;
            }
        }
Exemple #4
0
 internal StopwatchTimekeeper(string name)
 {
     Name = name;
     TimerStatistics = new TimekeeperSnapshot(Name);
 }