class TinyProfiler
Constants
- VERSION
Attributes
intervals[RW]
start_time[RW]
times[RW]
Public Instance Methods
finished()
click to toggle source
# File lib/tiny_profiler.rb, line 20 def finished interval = Time.now - @start_time @times["total"] = interval return @times end
interval(name)
click to toggle source
# File lib/tiny_profiler.rb, line 12 def interval(name) now = Time.now interval = now - @intervals.last @intervals << now @times[name] = interval p "#{name}: #{interval}" end
reset()
click to toggle source
# File lib/tiny_profiler.rb, line 32 def reset start end
start()
click to toggle source
# File lib/tiny_profiler.rb, line 26 def start @start_time = Time.now @intervals = [@start_time] @times = {} end