module Spectre::Diagnostic::Stopwatch
Public Class Methods
duration()
click to toggle source
# File lib/spectre/diagnostic.rb, line 21 def duration @@end_time - @@start_time end
measure() { || ... }
click to toggle source
# File lib/spectre/diagnostic.rb, line 15 def measure start_watch yield stop_watch end
start_watch()
click to toggle source
# File lib/spectre/diagnostic.rb, line 7 def start_watch @@start_time = Time.now end
stop_watch()
click to toggle source
# File lib/spectre/diagnostic.rb, line 11 def stop_watch @@end_time = Time.now end