Class: Luna::Binary::DogTimer

Inherits:
Object
  • Object
show all
Defined in:
lib/luna/binary/benchmark.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDogTimer

Returns a new instance of DogTimer.



19
20
21
# File 'lib/luna/binary/benchmark.rb', line 19

def initialize()
    
end

Instance Attribute Details

#delta_timeObject

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_timeObject

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_timeObject

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

#deltaObject



33
34
35
# File 'lib/luna/binary/benchmark.rb', line 33

def delta
    @delta_time = @end_time - @start_time
end

#endObject



28
29
30
31
# File 'lib/luna/binary/benchmark.rb', line 28

def end
    @end_time = Time.now()
    puts end_time
end


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

#startObject



23
24
25
26
# File 'lib/luna/binary/benchmark.rb', line 23

def start
    @start_time = Time.now()
    puts start_time
end