Sha256: f179cb8f73f27691e0ff6a86dc36c3a38831078224df58d7af129757274d3399

Contents?: true

Size: 246 Bytes

Versions: 62

Compression:

Stored size: 246 Bytes

Contents

class Timer
  attr_accessor :start_time

  def initialize
    @start_time=Time.now
  end

  def elapsed # in seconds
    return Time.now-@start_time
  end

  def elapsed_str
    elapsed_str="[" + "%.0f" %(elapsed) + "s]"
  end

end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
dev_tasks-0.0.99 lib/timer.rb
dev_tasks-0.0.98 lib/timer.rb
dev_tasks-0.0.97 lib/timer.rb
dev_tasks-0.0.96 lib/timer.rb
dev_tasks-0.0.94 lib/timer.rb
dev_tasks-0.0.93 lib/timer.rb
dev_tasks-0.0.92 lib/timer.rb
dev_tasks-0.0.91 lib/timer.rb
dev_tasks-0.0.90 lib/timer.rb
dev_tasks-0.0.89 lib/timer.rb
dev_tasks-0.0.88 lib/timer.rb
dev_tasks-0.0.87 lib/timer.rb
dev_tasks-0.0.86 lib/timer.rb
dev_tasks-0.0.85 lib/timer.rb
dev_tasks-0.0.84 lib/timer.rb
dev_tasks-0.0.83 lib/timer.rb
dev_tasks-0.0.82 lib/timer.rb
dev_tasks-0.0.81 lib/timer.rb
dev_tasks-0.0.80 lib/timer.rb
dev_tasks-0.0.79 lib/timer.rb