Created
January 11, 2019 16:51
-
-
Save olegantonyan/fd1b68b85609ab8e3272912a60044184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def benchmark(what) | |
start = ::Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
yield | |
finish = ::Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
puts "#{what} took #{finish - start} seconds" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment