From: Viktor Mihajlovski Date: Fri, 31 Aug 2012 11:32:45 +0000 (+0200) Subject: virsh: fixed incorrect timing report X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=641d406d27e060e47670332ba3754806e9366ac5;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git virsh: fixed incorrect timing report When executing virsh -t the reported timing was off by 3 orders of magnitude if the command took more than one second. Signed-off-by: Viktor Mihajlovski --- diff --git a/tools/virsh.c b/tools/virsh.c index 7a5b92c97..04d1b52ce 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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);