How do I get more precision that seconds in ruby? If I wanted to know 1
millisecond passed how would I do this?
Thanks for your help.
How do I get more precision that seconds in ruby? If I wanted to know 1
millisecond passed how would I do this?
Thanks for your help.
On Aug 22, 2006, at 12:23 PM, Ben J. wrote:
How do I get more precision that seconds in ruby? If I wanted to
know 1
millisecond passed how would I do this?
start = Time.now
=> Tue Aug 22 12:25:24 CDT 2006elapsed = start - Time.now
=> -16.744711
The fractional portion is fractional seconds. Hope that helps.
James Edward G. II
On Wed, 23 Aug 2006, Ben J. wrote:
How do I get more precision that seconds in ruby? If I wanted to know 1
millisecond passed how would I do this?Thanks for your help.
a = Time.now.to_f
b = Time.now.to_f
p(b - a)
also there’s Time.now.usec
-a
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs