You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the feeling 89f056b introduced a regression. The nanoseconds might return negative values if you compare the actual value with the one before. This does not occur in 5.3 or before.
It does not actually mean negative values, it looks to me that the values are just not normalized.
I.e. it returns [1, -692093386] when it should return [0, 307906614].
Activity
jasnell commentedon Jan 19, 2016
@Fishrock123 @trevnorris
ChALkeR commentedon Jan 19, 2016
I can reproduce this.
ChALkeR commentedon Jan 19, 2016
It does not actually mean negative values, it looks to me that the values are just not normalized.
I.e. it returns
[1, -692093386]when it should return[0, 307906614].ChALkeR commentedon Jan 19, 2016
89f056b#diff-6ff379484cbabad48301d485db111c08R198does:
ret[1] = hrValues[2] - ar[1];does not take into an account thathrValues[2]could be less thanar[1].ChALkeR commentedon Jan 19, 2016
The simplified fast test would be:
process.hrtime([0, 999999999])[1] >= 0.mscdex commentedon Jan 19, 2016
I also noticed this recently and was really confused.
trevnorris commentedon Jan 19, 2016
My bad. I'll write up a patch and additional test case for this ASAP.
src: fix negative values in process.hrtime()