Class: Skylight::Util::Clock Private
- Defined in:
- lib/skylight/util/clock.rb,
ext/skylight_native.c
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .absolute_secs ⇒ Object private
- .default ⇒ Object private
- .default=(clock) ⇒ Object private
- .nanos ⇒ Object private
- .secs ⇒ Object private
Instance Method Summary collapse
-
#absolute_secs ⇒ Object
private
TODO: rename to secs.
-
#nanos ⇒ Object
private
TODO: remove.
-
#native_hrtime ⇒ Object
private
class Skylight::Util::Clock.
-
#secs ⇒ Object
private
TODO: remove.
- #tick ⇒ Object private
Class Method Details
.absolute_secs ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/skylight/util/clock.rb', line 31 def self.absolute_secs default.absolute_secs end |
.default ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 |
# File 'lib/skylight/util/clock.rb', line 43 def self.default @clock ||= Clock.new end |
.default=(clock) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/skylight/util/clock.rb', line 47 def self.default=(clock) @clock = clock end |
.nanos ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/skylight/util/clock.rb', line 35 def self.nanos default.nanos end |
.secs ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/skylight/util/clock.rb', line 39 def self.secs default.secs end |
Instance Method Details
#absolute_secs ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
TODO: rename to secs
17 18 19 |
# File 'lib/skylight/util/clock.rb', line 17 def absolute_secs Time.now.to_i end |
#nanos ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
TODO: remove
22 23 24 |
# File 'lib/skylight/util/clock.rb', line 22 def nanos tick end |
#native_hrtime ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
class Skylight::Util::Clock
140 141 142 143 144 |
# File 'ext/skylight_native.c', line 140 static VALUE clock_high_res_time(VALUE self) { UNUSED(self); return ULL2NUM(sky_hrtime()); } |
#secs ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
TODO: remove
27 28 29 |
# File 'lib/skylight/util/clock.rb', line 27 def secs nanos / 1_000_000_000 end |
#tick ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/skylight/util/clock.rb', line 6 def tick native_hrtime end |