Skip to content

Commit

Permalink
Print out saved time due to sampling in percent.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Jan 7, 2025
1 parent 6228b28 commit a1ee1cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ModTek/Util/Stopwatch/MTStopwatchStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public override string ToString()
var ifAllMeasured = Count * MTStopwatch.GetTimestampOverheadInAndAfterMeasurement;
var onlySampledMeasured = sampled * MTStopwatch.GetTimestampOverheadInAndAfterMeasurement + Count * MTStopwatchWithSampling.SamplingCheckOverhead;
var saved = ifAllMeasured - onlySampledMeasured;
var savedTimeSan = MTStopwatch.TimeSpanFromTicks((long)saved);
suffix = $", sampling interval of {_samplingInterval} saved {savedTimeSan}";
var savedPercent = (byte)(saved / (Ticks + saved) * 100);
suffix = $", sampling interval of {_samplingInterval} saved {savedPercent}%";
}
return $"{verb} {Count} times, taking a total of {TotalTime} with an average of {AverageNanoseconds}ns{suffix}";
}
Expand Down

0 comments on commit a1ee1cc

Please sign in to comment.