diff --git a/src/backend/main/main.c b/src/backend/main/main.c index 582198f..f9994d0 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -263,8 +263,11 @@ startup_hacks(const char *progname) SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); #ifndef HAVE_GETTIMEOFDAY - /* Figure out which syscall to use to capture timestamp information */ - init_win32_gettimeofday(); + /* + * Try to utilize high resolution syscall to capture timestamp + * information + */ + init_win32_precise_gettimeofday(); #endif } diff --git a/src/include/port.h b/src/include/port.h index 26d7fcd..e53d19e 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -329,7 +329,7 @@ extern FILE *pgwin32_popen(const char *command, const char *type); /* Last parameter not used */ extern int gettimeofday(struct timeval * tp, struct timezone * tzp); /* On windows we need to call some backend start setup for accurate timing */ -extern void init_win32_gettimeofday(void); +extern void init_win32_precise_gettimeofday(void); #endif #else /* !WIN32 */ diff --git a/src/port/gettimeofday.c b/src/port/gettimeofday.c index eabf161..e81e03b 100644 --- a/src/port/gettimeofday.c +++ b/src/port/gettimeofday.c @@ -49,14 +49,14 @@ static const unsigned __int64 epoch = UINT64CONST(116444736000000000); typedef VOID (WINAPI *PgGetSystemTimeFn)(LPFILETIME); /* Storage for the function we pick at runtime */ -static PgGetSystemTimeFn pg_get_system_time = NULL; +static PgGetSystemTimeFn pg_get_system_time = &GetSystemTimeAsFileTime; /* * During backend startup, determine if GetSystemTimePreciseAsFileTime is * available and use it; if not, fall back to GetSystemTimeAsFileTime. */ void -init_win32_gettimeofday(void) +init_win32_precise_gettimeofday(void) { /* * Because it's guaranteed that kernel32.dll will be linked into our