Class: EaseEngine::MeasurePacket

Inherits:
Packet
  • Object
show all
Defined in:
lib/ease_engine/packet.rb

Instance Attribute Summary

Attributes inherited from Packet

#packet_name

Instance Method Summary collapse

Methods inherited from Packet

create, creates, #pack, pack_str, pack_uint16, pack_uint32, pack_uint8, #packer, #unpack, unpack_str, unpack_uint16, unpack_uint32, unpack_uint8, #write

Constructor Details

#initializeMeasurePacket

Returns a new instance of MeasurePacket.



126
127
128
129
130
131
132
# File 'lib/ease_engine/packet.rb', line 126

def initialize
  super
  
  packer :sec, :usec
  
  start
end

Instance Method Details

#checkObject



140
141
142
# File 'lib/ease_engine/packet.rb', line 140

def check
  EaseEngine::Time.new - ::Time.at( @sec, @usec )
end

#startObject



134
135
136
137
138
# File 'lib/ease_engine/packet.rb', line 134

def start
  time = ::Time.new
  @sec = time.to_i
  @usec = time.usec
end