Sha256: 2a1fffe622066b8a95be5afe3fa7c73bb2dae0a8c162f3bee44c88a4044c197a

Contents?: true

Size: 330 Bytes

Versions: 6

Compression:

Stored size: 330 Bytes

Contents

module Skylight
  module Util
    class Clock

      def now
        n = Time.now
        n.to_i + n.usec.to_f / 1_000_000
      end

      def self.now
        default.now
      end

      def self.default
        @clock ||= Clock.new
      end

      def self.default=(clock)
        @clock = clock
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
skylight-0.1.3 lib/skylight/util/clock.rb
skylight-0.1.2 lib/skylight/util/clock.rb
skylight-0.1.1 lib/skylight/util/clock.rb
skylight-0.1.0 lib/skylight/util/clock.rb
skylight-0.1.0.alpha2 lib/skylight/util/clock.rb
skylight-0.1.0.alpha1 lib/skylight/util/clock.rb