• Konstantin Khlebnikov's avatar
    * ioping -c|-w: do not oversleep · 9ffe820b
    Konstantin Khlebnikov authored
    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: default avatarKir Kolyshkin <kir@openvz.org>
    
    9ffe820b
ioping.c 10.4 KB