9
10
11
12
13
14
15
16
17
18
|
# File 'lib/easy_timer.rb', line 9
def timer(options = {}, &block)
start_time = Time.now
yield
total_time = Time.at(Time.now - start_time)
if options[:verbose] || options[:v]
return total_time.verbose
else
return total_time
end
end
|