1
How to calculate in milliseconds the time of an action in ruby?
I’m doing it this way:
start_time = Time.now
I run a certain code that takes a few milliseconds
end_time = (Time.now - start_time)
And as a result I get for example: 0.048813
The question is: This value I got is in milliseconds (ms) or is in seconds?
How do I check it with fewer decimal places, like 48.81 ms ?
Perfect. It worked fine. I had seen the documentation but didn’t understand this form of rounding.
– Fábio Jansen