* ioping -c|-w: do not oversleep
This commit addresses two similar (but distinct) bugs.
(1) 'ioping -c' was needlessly sleeping after the last iteration
(and before showing final stats). Fix it by moving the check
to before the usleep(), not after.
(2) 'ioping -w' was going over the time limit specified. For example,
'ioping -w 7 -i 2' was taking 8 seconds to run, not 7 or less.
Fix it by moving the check to before usleep(), and taking
the interval (ie usleep argument) into account.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Showing
Please register or sign in to comment