Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[trivial] fix timer precision. #198

Merged
merged 4 commits into from
Nov 27, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/search/utils/timer.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "timer.h"

#include <ctime>
#include <iomanip>
#include <ostream>

#if OPERATING_SYSTEM == LINUX || OPERATING_SYSTEM == OSX
Expand Down Expand Up @@ -110,7 +111,7 @@ Duration Timer::reset() {
}

ostream &operator<<(ostream &os, const Timer &timer) {
os << timer();
os << fixed << setprecision(6) << timer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think two decimals are enough. This would also match the time precision we use in Lab.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree that two decimals are enough. There's a difference between having two digits of precision for things like overall planner runtime in a lab report and being unable to report internal timings with a higher granularity. If we reduce the precision so far, I think this falls outside the scope of a "trivial" change. It would need discussion and mentioning in the release notes.

Can you update the pull request back to 6 digits? We can discuss a further reduction separately if you feel strongly about this, Jendrik. I personally think 6 digits (microseconds) is quite reasonable as a default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly about this. 6 digits is fine for me as well.

return os;
}

Expand Down
Loading