Is it unheard of that class singleton method does not return class in
core?
Do we need monotonic time?
Can we reasonably provide it to multiple OS?
In which class should it appear?
I feel pretty much 100% of timers in every code are broken, because
UTC and consequently unixtime is not monotonic today, it might be in
few years time.
Some languages offer nice timestamp function to monotonic time, ruby
does not.
Yes, we have Process.clock_gettime in Ruby 2.1+
It supports POSIX and (from reading the code) OSX, at least.
Thanks it does work in OSX, just tried. But really it’s not very
portable, I think it’s pretty crucial that language offers function
like this https://github.com/rust-lang/rust/blob/master/src/libtime/lib.rs#L146
but granted personally I’m never on Windows, so for me
Process.clock_gettime is good enough.
For general use, I think the need for this is so common, it really
should be core’s responsibility to offer portable solution for typical
problem.
From: ruby-talk [email protected] on behalf of Saku Y. [email protected]
Sent: Friday, August 15, 2014 5:09 AM
To: Ruby users
Subject: Re: Ruby and monotonic time
Yes, we have Process.clock_gettime in Ruby 2.1+
It supports POSIX and (from reading the code) OSX, at least.
Thanks it does work in OSX, just tried. But really it’s not very
portable, I think it’s pretty crucial that language offers function
like this https://github.com/rust-lang/rust/blob/master/src/libtime/lib.rs#L146
but granted personally I’m never on Windows, so for me
Process.clock_gettime is good enough.
For general use, I think the need for this is so common, it really
should be core’s responsibility to offer portable solution for typical
problem.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.