Microtime / Milliseconds?

B

Ben Johnson

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.
 
J

James Edward Gray II

How do I get more precision that seconds in ruby? If I wanted to
know 1
millisecond passed how would I do this?
=> -16.744711

The fractional portion is fractional seconds. Hope that helps.

James Edward Gray II
 
A

ara.t.howard

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,210
Messages
2,571,091
Members
47,691
Latest member
Jenny-jane

Latest Threads

Top