virsh: fixed incorrect timing report

When executing virsh -t <command> the reported timing was off
by 3 orders of magnitude if the command took more than one
second.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
Viktor Mihajlovski 2012-08-31 13:32:45 +02:00 committed by Daniel Veillard
parent eac1ab053c
commit 641d406d27

View File

@ -1509,7 +1509,7 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd)
return ret;
if (enable_timing) {
double diff_ms = (((after.tv_sec - before.tv_sec) * 1000000.0) +
double diff_ms = (((after.tv_sec - before.tv_sec) * 1000.0) +
((after.tv_usec - before.tv_usec) / 1000.0));
vshPrint(ctl, _("\n(Time: %.3f ms)\n\n"), diff_ms);