Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/timestamp.rb
Constant Summary collapse
- @@timestamp =
Java::Default::Timestamp.new.tap{|ts| ts.java_send :basicLoad, [org.jruby.Ruby], org.jruby.Ruby.getGlobalRuntime }
Class Method Summary collapse
-
.timestamp ⇒ Integer
Returns a nanosecond timestamp on the system’s monotonic clock.
-
.unix_microtime ⇒ Float
Returns the current time as a floating-point number of seconds since the Epoch.
-
.unix_timestamp ⇒ Object
(also: unix_time)
Returns the current time as an integer number of seconds since the Epoch.
Class Method Details
.timestamp ⇒ Integer
Returns a nanosecond timestamp on the system’s monotonic clock.
Time. #=> 17817203921822
33 34 35 |
# File 'ext/timestamp/Timestamp.c', line 33 def .java_send :timestamp, [] end |
.unix_microtime ⇒ Float
Returns the current time as a floating-point number of seconds since the Epoch.
Time.unix_microtime #=> 1363352771.315240
83 84 85 |
# File 'ext/timestamp/Timestamp.c', line 83 def unix_microtime .java_send :unix_microtime, [] end |
.unix_timestamp ⇒ Integer .unix_time ⇒ Integer Also known as: unix_time
Returns the current time as an integer number of seconds since the Epoch.
Time. #=> 1363352771
Time.unix_time #=> 1363352771
67 68 69 |
# File 'ext/timestamp/Timestamp.c', line 67 def .java_send :unix_timestamp, [] end |