Class: Mach::Clock
Instance Method Summary collapse
- #get_time ⇒ Object
-
#initialize(clock_id) ⇒ Clock
constructor
A new instance of Clock.
- #to_s ⇒ Object
Methods included from Functions
attach_mach_function, error_check, error_check_bootstrap, new_memory_pointer, #new_memory_pointer
Methods included from Types
Constructor Details
#initialize(clock_id) ⇒ Clock
Returns a new instance of Clock.
9 10 11 |
# File 'lib/mach/clock.rb', line 9 def initialize(clock_id) @clock_id = clock_id end |
Instance Method Details
#get_time ⇒ Object
17 18 19 20 21 |
# File 'lib/mach/clock.rb', line 17 def get_time time = TimeSpec.new clock_get_time(@clock_id.to_i, time) time end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/mach/clock.rb', line 13 def to_s "#<#{self.class} #{@clock_id.to_i}>" end |