Classes: Duration
24 25 26 27 28 29
# File 'lib/quickdraw/timer.rb', line 24 def self.time start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) yield finish = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) Duration.new(finish - start) end