Watch command smallest -n interval

watch

What is the smallest interval for the watch command?

The man page and Google searches do not indicate what the smallest interval lower limit is. I found through experimentation it can be smaller than 1 second.

To test, I ran this command run on a firewall:

watch -n 0.1 cat /sys/class/net/eth1/statistics/rx_bytes

It clearly updates faster than one second, but it is not clear if it is really doing 100ms updates.

Best Answer

What platform are you on?

On my Linux (Ubuntu 14.10) the man page says:

 -n, --interval seconds
          Specify  update  interval. The  command will not allow quicker
          than 0.1 second interval, in which the smaller values  are  con‐
          verted.

I just tested this with a script calling a C-program that prints the timestamp with microseconds and it works.

Related Question