#include <sys/time.h>
Go to the source code of this file.
Defines | |
#define | INSTR_TIME_IS_ZERO(t) ((t).tv_usec == 0 && (t).tv_sec == 0) |
#define | INSTR_TIME_SET_ZERO(t) ((t).tv_sec = 0, (t).tv_usec = 0) |
#define | INSTR_TIME_SET_CURRENT(t) gettimeofday(&(t), NULL) |
#define | INSTR_TIME_ADD(x, y) |
#define | INSTR_TIME_SUBTRACT(x, y) |
#define | INSTR_TIME_ACCUM_DIFF(x, y, z) |
#define | INSTR_TIME_GET_DOUBLE(t) (((double) (t).tv_sec) + ((double) (t).tv_usec) / 1000000.0) |
#define | INSTR_TIME_GET_MILLISEC(t) (((double) (t).tv_sec * 1000.0) + ((double) (t).tv_usec) / 1000.0) |
#define | INSTR_TIME_GET_MICROSEC(t) (((uint64) (t).tv_sec * (uint64) 1000000) + (uint64) (t).tv_usec) |
Typedefs | |
typedef struct timeval | instr_time |
#define INSTR_TIME_ACCUM_DIFF | ( | x, | ||
y, | ||||
z | ||||
) |
do { \ (x).tv_sec += (y).tv_sec - (z).tv_sec; \ (x).tv_usec += (y).tv_usec - (z).tv_usec; \ /* Normalize after each add to avoid overflow/underflow of tv_usec */ \ while ((x).tv_usec < 0) \ { \ (x).tv_usec += 1000000; \ (x).tv_sec--; \ } \ while ((x).tv_usec >= 1000000) \ { \ (x).tv_usec -= 1000000; \ (x).tv_sec++; \ } \ } while (0)
Definition at line 91 of file instr_time.h.
Referenced by BufferUsageAccumDiff(), doCustom(), InstrStopNode(), and threadRun().
#define INSTR_TIME_ADD | ( | x, | ||
y | ||||
) |
do { \ (x).tv_sec += (y).tv_sec; \ (x).tv_usec += (y).tv_usec; \ /* Normalize */ \ while ((x).tv_usec >= 1000000) \ { \ (x).tv_usec -= 1000000; \ (x).tv_sec++; \ } \ } while (0)
Definition at line 67 of file instr_time.h.
Referenced by FlushBuffer(), main(), pgstat_end_function_usage(), printResults(), and ReadBuffer_common().
#define INSTR_TIME_GET_DOUBLE | ( | t | ) | (((double) (t).tv_sec) + ((double) (t).tv_usec) / 1000000.0) |
Definition at line 108 of file instr_time.h.
Referenced by agg_vals_init(), doCustom(), elapsed_time(), init(), InstrEndLoop(), InstrStopNode(), printResults(), and test_timing().
#define INSTR_TIME_GET_MICROSEC | ( | t | ) | (((uint64) (t).tv_sec * (uint64) 1000000) + (uint64) (t).tv_usec) |
Definition at line 114 of file instr_time.h.
Referenced by count_nondeletable_pages(), doCustom(), FlushBuffer(), main(), mdsync(), pgstat_send_funcstats(), ReadBuffer_common(), test_timing(), and threadRun().
#define INSTR_TIME_GET_MILLISEC | ( | t | ) | (((double) (t).tv_sec * 1000.0) + ((double) (t).tv_usec) / 1000.0) |
Definition at line 111 of file instr_time.h.
Referenced by ExecQueryUsingCursor(), ExplainNode(), pg_stat_get_xact_function_self_time(), pg_stat_get_xact_function_total_time(), pgss_ProcessUtility(), pgss_store(), printResults(), SendQuery(), and WaitLatchOrSocket().
#define INSTR_TIME_IS_ZERO | ( | t | ) | ((t).tv_usec == 0 && (t).tv_sec == 0) |
Definition at line 61 of file instr_time.h.
Referenced by ExplainNode(), InstrEndLoop(), InstrStartNode(), and InstrStopNode().
#define INSTR_TIME_SET_CURRENT | ( | t | ) | gettimeofday(&(t), NULL) |
Definition at line 65 of file instr_time.h.
Referenced by count_nondeletable_pages(), doCustom(), elapsed_time(), ExecQueryUsingCursor(), ExplainOnePlan(), FlushBuffer(), init(), InstrStartNode(), InstrStopNode(), main(), mdsync(), pgss_ProcessUtility(), pgstat_end_function_usage(), pgstat_init_function_usage(), ReadBuffer_common(), SendQuery(), test_timing(), threadRun(), and WaitLatchOrSocket().
#define INSTR_TIME_SET_ZERO | ( | t | ) | ((t).tv_sec = 0, (t).tv_usec = 0) |
Definition at line 63 of file instr_time.h.
Referenced by InstrEndLoop(), InstrStopNode(), main(), printResults(), and threadRun().
#define INSTR_TIME_SUBTRACT | ( | x, | ||
y | ||||
) |
do { \ (x).tv_sec -= (y).tv_sec; \ (x).tv_usec -= (y).tv_usec; \ /* Normalize */ \ while ((x).tv_usec < 0) \ { \ (x).tv_usec += 1000000; \ (x).tv_sec--; \ } \ } while (0)
Definition at line 79 of file instr_time.h.
Referenced by count_nondeletable_pages(), doCustom(), elapsed_time(), ExecQueryUsingCursor(), FlushBuffer(), init(), main(), mdsync(), pgss_ProcessUtility(), pgstat_end_function_usage(), ReadBuffer_common(), SendQuery(), test_timing(), threadRun(), and WaitLatchOrSocket().
typedef struct timeval instr_time |
Definition at line 59 of file instr_time.h.