-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: round nsec instead of truncating stat times #12607
Changes from 3 commits
fc381a3
4e113b9
a474c1a
3e5afc1
519150d
a6268a8
ac3bfa5
bad1f6f
96b8712
32c1639
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -475,9 +475,9 @@ void FillStatsArray(double* fields, const uv_stat_t* s) { | |
fields[9] = -1; | ||
#endif | ||
// Dates. | ||
#define X(idx, name) \ | ||
fields[idx] = (static_cast<double>(s->st_##name.tv_sec) * 1000) + \ | ||
(static_cast<double>(s->st_##name.tv_nsec / 1000000)); \ | ||
#define X(idx, name) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: remove the 4 spaces (just keep this line as it was) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's now 84 chars long, and would fail the linter. |
||
fields[idx] = (s->st_##name.tv_sec * 1e3) + \ | ||
(s->st_##name.tv_nsec / 1e6); \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh yeah, I didn't follow the braces, assumed it was the same as the line above... |
||
|
||
X(10, atim) | ||
X(11, mtim) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know right.. wish it was my idea. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind placing a comment above these. I can see someone doing a refactor a year from now and accidentally removing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, these lines no longer exist though, but the +0.5s are still around and have been merged in. I'll add the comment. With #13173 the +0.5s aren't quite as needed anymore, since the goes away if you use
mtimeMs
etc. instead ofmtime
.