Skip to content

Commit

Permalink
fix(examples): fix calculate elapsed time in ping.lua
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Nov 25, 2023
1 parent a60b9ca commit f3a4e72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/network/ping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ while true do
if icmp_type then
if icmp_type == ICMP_ECHOREPLY then
if id == local_id then
print(string.format('%d bytes from %s: icmp_seq=%d time=%.2f ms', n, dest_ip, seq, elapsed))
print(string.format('%d bytes from %s: icmp_seq=%d time=%.3f ms', n, dest_ip, seq, elapsed * 1000))
end
else
print('Got ICMP packet with type ' .. icmp_type)
Expand Down

0 comments on commit f3a4e72

Please sign in to comment.