Class: Mach::Clock

Inherits:
Object
  • Object
show all
Includes:
Functions
Defined in:
lib/mach/clock.rb

Instance Method Summary collapse

Methods included from Functions

attach_mach_function, error_check, error_check_bootstrap, new_memory_pointer, #new_memory_pointer

Methods included from Types

#enum, #find_type, typedefs

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_timeObject


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_sObject


13
14
15
# File 'lib/mach/clock.rb', line 13

def to_s
  "#<#{self.class} #{@clock_id.to_i}>"
end