Class: SqsPoller::Common::Utils::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/sqspoller/common/utils.rb

Instance Method Summary collapse

Constructor Details

#initializeTimer

Returns a new instance of Timer.



23
24
25
# File 'lib/sqspoller/common/utils.rb', line 23

def initialize
  start
end

Instance Method Details

#startObject



35
36
37
# File 'lib/sqspoller/common/utils.rb', line 35

def start
  @start_time = SqsPoller::Common::Utils.get_current_time_in_millis
end

#start_timeObject



27
28
29
# File 'lib/sqspoller/common/utils.rb', line 27

def start_time
  @start_time
end

#stopObject



39
40
41
42
# File 'lib/sqspoller/common/utils.rb', line 39

def stop
  @stop_time = SqsPoller::Common::Utils.get_current_time_in_millis
  @stop_time - @start_time
end

#stop_timeObject



31
32
33
# File 'lib/sqspoller/common/utils.rb', line 31

def stop_time
  @stop_time
end