+ 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.?
4 ответов
+ 6
Seconds, but with nanosecond resolution (there's 9 digits after the decimal point)
+ 4
For example:
o = Time.ow
# some code
r = Time.now
puts o-r
In what units will the result be represented?
+ 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
+ 2
Thanks