class Time

time

Public Class Methods

time(smsg="", emsg="%s seconds") { || ... } click to toggle source

Simple benchmark function. Time.time(start_msg) { … }

# File lib/el4r/el4r-sub.rb, line 72
def Time.time(smsg="", emsg="%s seconds")
  s=Time.now
  print smsg 
  puts if smsg != ""
  yield
  sec=Time.now - s
  printf emsg, sec
  puts ""
end