Avoid overflow for large elapsed times in \timing output. Per

Kenji Sugita.
This commit is contained in:
Tom Lane 2002-09-14 19:46:01 +00:00
parent d3ebc1ae4a
commit f7978c6f1d
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.44 2002/09/04 20:31:35 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.45 2002/09/14 19:46:01 tgl Exp $
*/
#include "postgres_fe.h"
@ -464,7 +464,7 @@ SendQuery(const char *query)
/* Possible microtiming output */
if (pset.timing && success)
printf(gettext("Time: %.2f ms\n"),
((after.tv_sec - before.tv_sec) * 1000000 + after.tv_usec - before.tv_usec) / 1000.0);
((after.tv_sec - before.tv_sec) * 1000000.0 + after.tv_usec - before.tv_usec) / 1000.0);
return success;
}