Sha256: 9318bec97613258724ec499740359f6bb6443e9049d293c5cac194219e8859fa

Contents?: true

Size: 826 Bytes

Versions: 1

Compression:

Stored size: 826 Bytes

Contents

require "logger"
require "concurrent"
require "net/http"
require "aws-sdk"

module SqsPoller
  module Common
    class Utils
      class << self

        def get_current_time_in_millis
          current_time = Time.now
          (current_time.to_f * 1000).to_i
        end

        def start_timer
          SqsPoller::Common::Utils::Timer.new
        end

      end

      class Timer
        def initialize
          start
        end

        def start_time
          @start_time
        end

        def stop_time
          @stop_time
        end

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

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

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fourkites-sqspoller-v2-1.0.0 lib/sqspoller/common/utils.rb