|
@@ -10,6 +10,7 @@ namespace bbiwarg.Utility
|
|
|
class Timer
|
|
|
{
|
|
|
private static Dictionary<String, Stopwatch> stopwatches = new Dictionary<string, Stopwatch>();
|
|
|
+ private static Dictionary<String, double> currentTimes = new Dictionary<string, double>();
|
|
|
private static Dictionary<String, double> minTimes = new Dictionary<string, double>();
|
|
|
private static Dictionary<String, double> maxTimes = new Dictionary<string, double>();
|
|
|
private static Dictionary<String, double> sumTimes = new Dictionary<string, double>();
|
|
@@ -23,6 +24,7 @@ namespace bbiwarg.Utility
|
|
|
maxTimes.Add(name, 0);
|
|
|
sumTimes.Add(name, 0);
|
|
|
numTimes.Add(name, 0);
|
|
|
+ currentTimes.Add(name, 0);
|
|
|
}
|
|
|
stopwatches[name].Restart();
|
|
|
}
|
|
@@ -34,11 +36,12 @@ namespace bbiwarg.Utility
|
|
|
if (time > maxTimes[name]) maxTimes[name] = time;
|
|
|
sumTimes[name] += time;
|
|
|
numTimes[name]++;
|
|
|
+ currentTimes[name] = time;
|
|
|
}
|
|
|
|
|
|
public static void output(String name) {
|
|
|
- Logger.log(String.Format("name:{0}\tavg:{1:00.00}\tmin:{2:00.00}\tmax:{3:00.00}",
|
|
|
- name, sumTimes[name] / Math.Max(numTimes[name], 1), minTimes[name], maxTimes[name]), LogSubject.Timer);
|
|
|
+ Logger.log(String.Format("name:{0}\tavg:{1:00.00}\tcurrent:{2:00.00}",
|
|
|
+ name, sumTimes[name] / Math.Max(numTimes[name], 1), currentTimes[name]), LogSubject.Timer);
|
|
|
}
|
|
|
|
|
|
public static void outputAll()
|