Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/quandl/operation/core_ext/time.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.elapsed(message = nil, &block) ⇒ Object
14 15 16 |
# File 'lib/quandl/operation/core_ext/time.rb', line 14 def elapsed(=nil, &block) log_elapsed(, &block) end |
Instance Method Details
#elapsed ⇒ Object
24 25 26 |
# File 'lib/quandl/operation/core_ext/time.rb', line 24 def elapsed elapsed_since(Time.now) end |
#elapsed_ms ⇒ Object
32 33 34 |
# File 'lib/quandl/operation/core_ext/time.rb', line 32 def elapsed_ms "#{elapsed.microseconds}ms" end |
#elapsed_since(time) ⇒ Object
28 29 30 |
# File 'lib/quandl/operation/core_ext/time.rb', line 28 def elapsed_since(time) time - self end |
#microseconds ⇒ Object
20 21 22 |
# File 'lib/quandl/operation/core_ext/time.rb', line 20 def microseconds (self.to_f * 1000.0).to_i end |