mirror of
https://github.com/smoltcp-rs/smoltcp.git
synced 2025-10-02 15:15:05 +00:00
Fix an off-by-1000 in time display in examples/ping.rs.
This commit is contained in:
parent
95fd1f2568
commit
21ca116fd7
@ -118,10 +118,10 @@ fn main() {
|
|||||||
|
|
||||||
if let Icmpv4Repr::EchoReply { seq_no, data, .. } = icmp_repr {
|
if let Icmpv4Repr::EchoReply { seq_no, data, .. } = icmp_repr {
|
||||||
if let Some(_) = waiting_queue.get(&seq_no) {
|
if let Some(_) = waiting_queue.get(&seq_no) {
|
||||||
let packet_timestamp_us = NetworkEndian::read_i64(data);
|
let packet_timestamp_ms = NetworkEndian::read_i64(data);
|
||||||
println!("{} bytes from {}: icmp_seq={}, time={:.3}ms",
|
println!("{} bytes from {}: icmp_seq={}, time={}ms",
|
||||||
data.len(), remote_addr, seq_no,
|
data.len(), remote_addr, seq_no,
|
||||||
(timestamp.total_millis() - packet_timestamp_us) as f64 / 1000.0);
|
timestamp.total_millis() - packet_timestamp_ms);
|
||||||
waiting_queue.remove(&seq_no);
|
waiting_queue.remove(&seq_no);
|
||||||
received += 1;
|
received += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user