What units does the method "Time.now" use milliseconds, seconds, minutes, etc.? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

What units does the method "Time.now" use milliseconds, seconds, minutes, etc.?

What units does the method "Time.now" use milliseconds, seconds, minutes, etc.?

24th Mar 2019, 1:23 PM
Виктор Носов
Виктор Носов - avatar
4 Answers
+ 6
Seconds, but with nanosecond resolution (there's 9 digits after the decimal point)
24th Mar 2019, 2:01 PM
Schindlabua
Schindlabua - avatar
+ 4
For example: o = Time.ow # some code r = Time.now puts o-r In what units will the result be represented?
24th Mar 2019, 1:43 PM
Виктор Носов
Виктор Носов - avatar
+ 4
The units used for the "Time.now" in ruby is the time implementation sign the 63bit integer,rational. And the integer is a number of nanoseconds...yes...it uses the seconds...but specifically nanoseconds
3rd Oct 2019, 6:02 PM
Kevin Omondi
Kevin Omondi - avatar
+ 2
Thanks
24th Mar 2019, 2:26 PM
Виктор Носов
Виктор Носов - avatar