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

src: round nsec instead of truncating stat times #12607

Closed
wants to merge 10 commits into from
Prev Previous commit
add comment explaining +0.5
  • Loading branch information
sciolist committed May 25, 2017
commit 32c1639d21ce35d6860a87b5f33024e828fc95e7
2 changes: 2 additions & 0 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ fs.Stats = Stats;
// defining the properties in this fashion (explicitly with no loop or factory)
// has been shown to be the most performant on V8 contemp.
// Ref: https://github.com/nodejs/node/pull/12818
// +0.5 is added to the Dates to protect values from being rounded down
// Ref: https://github.com/nodejs/node/pull/12607
Object.defineProperties(Stats.prototype, {
atime: {
configurable: true,
Expand Down