Class OpenWFE::Timer
In: lib/openwfe/utils.rb
Parent: Object

A small Timer class for debug purposes.

    t = Time.new

    # ... do something

    puts "that something took #{t.duration} ms"

Methods

duration   new  

Attributes

start  [R] 

Public Class methods

[Source]

     # File lib/openwfe/utils.rb, line 334
334:         def initialize
335:             @start = Time.now.to_f
336:         end

Public Instance methods

Returns the number of milliseconds since this Timer was instantiated.

[Source]

     # File lib/openwfe/utils.rb, line 342
342:         def duration
343:             (Time.now.to_f - @start) * 1000
344:         end

[Validate]