Commit 0e36b374 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

'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>
parent 9ffe820b
...@@ -466,7 +466,7 @@ int main (int argc, char **argv) ...@@ -466,7 +466,7 @@ int main (int argc, char **argv)
if (count && request >= count) if (count && request >= count)
break; break;
if (deadline && now() >= deadline) if (deadline && now() + interval >= deadline)
break; break;
usleep(interval); usleep(interval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment