Class: ProcessShared::Posix::TimeVal

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/process_shared/posix/time_val.rb

Constant Summary

US_PER_NS =
1000

Instance Method Summary collapse

Instance Method Details

#to_time_specObject



13
14
15
16
17
18
19
20
# File 'lib/process_shared/posix/time_val.rb', line 13

def to_time_spec
  ts = TimeSpec.new

  ts[:tv_sec] = self[:tv_sec];
  ts[:tv_nsec] = self[:tv_usec] * US_PER_NS

  ts
end