1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Windows: use GetSystemTimePreciseAsFileTime if available

PostgreSQL on Windows 8 or Windows Server 2012 will now
get high-resolution timestamps by dynamically loading the
GetSystemTimePreciseAsFileTime function. It'll fall back to
to GetSystemTimeAsFileTime if the higher precision variant
isn't found, so the same binaries without problems on older
Windows releases.

No attempt is made to detect the Windows version.  Only the
presence or absence of the desired function is considered.

Craig Ringer
This commit is contained in:
Simon Riggs
2014-12-08 23:36:06 +09:00
parent 519b0757a3
commit 8001fe67a3
3 changed files with 59 additions and 2 deletions

View File

@@ -328,6 +328,8 @@ extern FILE *pgwin32_popen(const char *command, const char *type);
#ifndef HAVE_GETTIMEOFDAY
/* 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);
#endif
#else /* !WIN32 */