Class: Luna::Binary::DogTimer
- Inherits:
-
Object
- Object
- Luna::Binary::DogTimer
- Defined in:
- lib/luna/binary/benchmark.rb
Instance Attribute Summary collapse
-
#delta_time ⇒ Object
Returns the value of attribute delta_time.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
- #delta ⇒ Object
- #end ⇒ Object
-
#initialize ⇒ DogTimer
constructor
A new instance of DogTimer.
- #print ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ DogTimer
Returns a new instance of DogTimer.
19 20 21 |
# File 'lib/luna/binary/benchmark.rb', line 19 def initialize() end |
Instance Attribute Details
#delta_time ⇒ Object
Returns the value of attribute delta_time.
18 19 20 |
# File 'lib/luna/binary/benchmark.rb', line 18 def delta_time @delta_time end |
#end_time ⇒ Object
Returns the value of attribute end_time.
17 18 19 |
# File 'lib/luna/binary/benchmark.rb', line 17 def end_time @end_time end |
#start_time ⇒ Object
Returns the value of attribute start_time.
16 17 18 |
# File 'lib/luna/binary/benchmark.rb', line 16 def start_time @start_time end |
Instance Method Details
#delta ⇒ Object
33 34 35 |
# File 'lib/luna/binary/benchmark.rb', line 33 def delta @delta_time = @end_time - @start_time end |
#end ⇒ Object
28 29 30 31 |
# File 'lib/luna/binary/benchmark.rb', line 28 def end @end_time = Time.now() puts end_time end |
#print ⇒ Object
37 38 39 |
# File 'lib/luna/binary/benchmark.rb', line 37 def print puts "start time: #{start_time.inspect} end time: #{end_time.inspect} delta time: #{delta}s ".yellow end |
#start ⇒ Object
23 24 25 26 |
# File 'lib/luna/binary/benchmark.rb', line 23 def start @start_time = Time.now() puts start_time end |