Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ StopAndPrint()

bool ReLogic.Utilities.MultiTimer.StopAndPrint ( )
inline

Definition at line 78 of file MultiTimer.cs.

79 {
80 _timer.Stop();
83 {
85 Console.WriteLine("Average elapsed time: ");
86 double num = 0.0;
87 int num2 = 0;
89 {
90 num2 = Math.Max(item3.Key.Length, num2);
91 }
93 {
94 TimerData value = item2.Value;
95 string text = new string(' ', num2 - item2.Key.Length);
96 Console.WriteLine(item2.Key + text + " : (Average: " + value.Average.ToString("F4") + " Min: " + value.Min.ToString("F4") + " Max: " + value.Max.ToString("F4") + " from " + (int)value.Ticks + " records)");
97 num += value.Total;
98 }
100 Console.WriteLine("Total : " + (float)num / (float)_ticksBetweenPrint + "ms");
101 return true;
102 }
103 return false;
104 }
readonly Dictionary< string, TimerData > _timerDataMap
Definition MultiTimer.cs:49
readonly Stopwatch _timer
Definition MultiTimer.cs:47
readonly int _ticksBetweenPrint
Definition MultiTimer.cs:43
static void WriteLine()
Definition Console.cs:733
static byte Max(byte val1, byte val2)
Definition Math.cs:738

References ReLogic.Utilities.MultiTimer._ticksBetweenPrint, ReLogic.Utilities.MultiTimer._ticksElapsedForPrint, ReLogic.Utilities.MultiTimer._timer, ReLogic.Utilities.MultiTimer._timerDataMap, System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Math.Max(), System.Diagnostics.Stopwatch.Stop(), System.text, System.value, and System.Console.WriteLine().