]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: fixed incorrect timing report
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Fri, 31 Aug 2012 11:32:45 +0000 (13:32 +0200)
committerDaniel Veillard <veillard@redhat.com>
Fri, 31 Aug 2012 12:00:20 +0000 (20:00 +0800)
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>
tools/virsh.c

index 7a5b92c9766f5812c023274c4997a39d654fc295..04d1b52ce9b981121fc3bae01f121f640a06c3dc 100644 (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);