Command line (ping) numbers precision
Hello,
on my Ubuntu Server 13.04 64b (only command line) when I'm pinging another network entity I have one digit after decimal separator for rtt, like this: Code:
64 bytes from 10.10.10.2: icmp_seq=962 ttl=62 time=18.5 ms I need to have result with higher precision of rtt time, e.g.: Code:
64 bytes from 10.10.10.2: icmp_seq=962 ttl=62 time=18.467 ms Should I look for some locales or elsewhere? I apologize, I'm a total newbie I agree. It's urgent for me however (MSc thesis measurements), and I didn't know how to explicitly google it (decimals, separators, precision, resolution, ping, linux, command line - all combined in many ways). Regards. |
LOL! It just works for me.
Sorry for that. I think it's merely the version of ping, took me a bit, I assumed "-v", then "--version", but it's Capital-V "ping -V", down at the bottom. The other option is to grab the ping source and rewrite it to print with greater precision. I'd try to just get the correct copy of ping to suit your needs. Make sure the one you're using is not derived from Busybox, that may be your problem. Code:
ping 127.0.0.1 |
I've got iputils-sss20101006. So I'll connect it to the Internet and look for updates maybe (despite your version is older).
Regards. |
Two ideas here. Either use the -D switch which prints the time with nanoseconds before each line. You maybe have to use the -i option to turn of wait intervall between packets. Or just subtract 1 seconds. Check man page for better overview.
Code:
[1380115547.971681] 64 bytes from 127.0.0.1: icmp_req=1 ttl=56 time=18.3 ms |
Rtmistler, I've downgraded iputils-ping to your version but it didn't change anything.
I'll probably have to go on with zhjim's solution (-D +math) or to simply deal with smaller precision, while the issue remains unknown... But I'm still curious what is going on. ;) Regards. |
Here's your problem. From the iputils-s20101006 package, ping_common.c, function gather_statistics():
Code:
if (timing) { |
[Solved] Command line (ping) numbers precision
Thanks a lot for your investigation! :)
|
All times are GMT -5. The time now is 12:38 AM. |