commit
34c24c7c8c
|
@ -73,7 +73,7 @@ pub trait PcapSink {
|
|||
assert!(length <= 65535);
|
||||
|
||||
self.write_u32(timestamp.secs() as u32); // timestamp seconds
|
||||
self.write_u32(timestamp.millis() as u32); // timestamp microseconds
|
||||
self.write_u32(timestamp.micros() as u32); // timestamp microseconds
|
||||
self.write_u32(length as u32); // captured length
|
||||
self.write_u32(length as u32); // original length
|
||||
}
|
||||
|
|
|
@ -59,6 +59,12 @@ impl Instant {
|
|||
self.millis % 1000
|
||||
}
|
||||
|
||||
/// The fractional number of microseconds that have passed
|
||||
/// since the beginning of time.
|
||||
pub const fn micros(&self) -> i64 {
|
||||
self.millis % 1000 * 1000
|
||||
}
|
||||
|
||||
/// The number of whole seconds that have passed since the
|
||||
/// beginning of time.
|
||||
pub const fn secs(&self) -> i64 {
|
||||
|
|
Loading…
Reference in New Issue