aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index f74ce951409..b86d67e9281 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.188 2008/05/08 17:04:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.189 2008/05/14 19:10:29 tgl Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@@ -30,6 +30,8 @@
#include <sys/stat.h> /* for stat() */
#endif
+#include "portability/instr_time.h"
+
#include "libpq-fe.h"
#include "pqexpbuffer.h"
#include "dumputils.h"
@@ -282,24 +284,22 @@ exec_command(const char *cmd,
else if (pg_strcasecmp(cmd, "copy") == 0)
{
/* Default fetch-it-all-and-print mode */
- TimevalStruct before,
+ instr_time before,
after;
- double elapsed_msec = 0;
char *opt = psql_scan_slash_option(scan_state,
OT_WHOLE_LINE, NULL, false);
if (pset.timing)
- GETTIMEOFDAY(&before);
+ INSTR_TIME_SET_CURRENT(before);
success = do_copy(opt);
if (pset.timing && success)
{
- GETTIMEOFDAY(&after);
- elapsed_msec = DIFF_MSEC(&after, &before);
- printf(_("Time: %.3f ms\n"), elapsed_msec);
-
+ INSTR_TIME_SET_CURRENT(after);
+ INSTR_TIME_SUBTRACT(after, before);
+ printf(_("Time: %.3f ms\n"), INSTR_TIME_GET_MILLISEC(after));
}
free(opt);