From 3bc25384d7a698f25e418bdc5aa7cdd038477d9c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 14 May 2008 19:10:29 +0000 Subject: Move the "instr_time" typedef and associated macros into a new header file portability/instr_time.h, and add a couple more macros to eliminate some abstraction leakage we formerly had. Also update psql to use this header instead of its own copy of nearly the same code. This commit in itself is just code cleanup and shouldn't change anything. It lays some groundwork for the upcoming function-stats patch, though. --- src/backend/commands/explain.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/backend/commands/explain.c') diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 6fbdabd1d2b..0892cdbe3eb 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994-5, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.174 2008/05/12 20:01:59 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.175 2008/05/14 19:10:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -390,19 +390,7 @@ elapsed_time(instr_time *starttime) instr_time endtime; INSTR_TIME_SET_CURRENT(endtime); - -#ifndef WIN32 - endtime.tv_sec -= starttime->tv_sec; - endtime.tv_usec -= starttime->tv_usec; - while (endtime.tv_usec < 0) - { - endtime.tv_usec += 1000000; - endtime.tv_sec--; - } -#else /* WIN32 */ - endtime.QuadPart -= starttime->QuadPart; -#endif - + INSTR_TIME_SUBTRACT(endtime, *starttime); return INSTR_TIME_GET_DOUBLE(endtime); } -- cgit v1.2.3