I don't mind adding a `process.hrtime()` function, it would be useful
for benchmarks. The problem is that uv_hrtime() returns a 64 bits
unsigned integer, while JS numbers only have 53 bits of precision.
– Micheil
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
Alternatively, maybe just not worry about it, since 2**53 microseconds isn't hit until 2255. I hope to not be using Node then :-)
uv_hrtime() has nanosecond resolution and it's not necessarily a
timestamp, just an arbitrary monotonically increasing counter. But
yes, a tuple would work. Anyone feel like doing a pull request?
You could return it % 2^53: 2^53*1e-9/60/60/24 === 104 days
Or an object: {
mod2_53: (ts.tv_sec * NANOSEC + ts.tv_nsec) % 2^53
sec: ts.tv_sec
nsec: ts.tv_nsec }
--
Jorge.