diff options
author | lloyd <[email protected]> | 2008-10-17 13:30:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-10-17 13:30:34 +0000 |
commit | 4baf2b9ef44790fb2b643ef2cdb4101b7be43c3b (patch) | |
tree | 8d7db80121c56c2bd90ee4874ba5c911028dcd32 | |
parent | 838f2b49fe4aa964029aa29a8a2bdf62ba328dc8 (diff) |
Timer tried to guess if it should use seconds or ms, but it always choose
the wrong one in some situation or another. Just print milliseconds
no matter what.
Also it's easier to read/compare if everything is in the same unit (obv)
-rw-r--r-- | checks/timer.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/checks/timer.cpp b/checks/timer.cpp index a5225f23b..8ebbcb4ce 100644 --- a/checks/timer.cpp +++ b/checks/timer.cpp @@ -37,19 +37,10 @@ std::ostream& operator<<(std::ostream& out, Timer& timer) out << events_per_second << " " << timer.get_name() << " per second; "; - if(timer.seconds_per_event() < 1) - out << std::setprecision(2) << std::fixed - << timer.ms_per_event() << " ms/" << timer.get_name(); - else - out << std::setprecision(4) << std::fixed - << timer.seconds_per_event() << " s/" << timer.get_name(); - - if(timer.seconds() > 3) - out << " (" << timer.events() << " ops in " - << timer.milliseconds() << " ms)"; - else - out << " (" << timer.events() << " ops in " - << timer.seconds() << " s)"; + out << std::setprecision(2) << std::fixed + << timer.ms_per_event() << " ms/" << timer.get_name() + << " (" << timer.events() << " ops in " + << timer.milliseconds() << " ms)"; return out; } |