Ruby Calculate Execution Time

[Solved] Ruby Calculate Execution Time | Ruby - Code Explorer | yomemimo.com
Question : ruby calculate execution time

Answered by : christopher-olson

starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
# time consuming operation(s)
ending = Process.clock_gettime(Process::CLOCK_MONOTONIC)
elapsed = ending - starting
elapsed # => 9.424242424242424 seconds

Source : | Last Update : Wed, 24 Jun 20

Answers related to ruby calculate execution time

Code Explorer Popular Question For Ruby