Class: Time

Inherits:
Object show all
Defined in:
lib/story_teller/events.rb

Overview

The Time class

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.msObject



32
33
34
# File 'lib/story_teller/events.rb', line 32

def self.ms
  self.now.to_ms
end

.nsObject



28
29
30
# File 'lib/story_teller/events.rb', line 28

def self.ns
  self.now.to_f
end

.sObject



36
37
38
# File 'lib/story_teller/events.rb', line 36

def self.s
  self.now.to_i
end

Instance Method Details

#to_msObject



24
25
26
# File 'lib/story_teller/events.rb', line 24

def to_ms
  (self.to_f * 1000.0).to_i
end