Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions | Variables

gettimeofday.c File Reference

#include "c.h"
#include <sys/time.h>
Include dependency graph for gettimeofday.c:

Go to the source code of this file.

Functions

int gettimeofday (struct timeval *tp, struct timezone *tzp)

Variables

static const unsigned __int64 epoch = UINT64CONST(116444736000000000)

Function Documentation

int gettimeofday ( struct timeval *  tp,
struct timezone tzp 
)

Definition at line 44 of file gettimeofday.c.

References epoch.

Referenced by BootStrapXLOG(), CheckRADIUSAuth(), enough_time_passed(), GetCurrentIntegerTimestamp(), GetCurrentTimestamp(), GuessControlValues(), IsCheckpointOnSchedule(), localGetCurrentTimestamp(), pg_rusage_init(), PostmasterMain(), PostmasterRandom(), ResetUsage(), setup_formatted_log_time(), ShowUsage(), timeofday(), and try_unix_std().

{
    FILETIME    file_time;
    SYSTEMTIME  system_time;
    ULARGE_INTEGER ularge;

    GetSystemTime(&system_time);
    SystemTimeToFileTime(&system_time, &file_time);
    ularge.LowPart = file_time.dwLowDateTime;
    ularge.HighPart = file_time.dwHighDateTime;

    tp->tv_sec = (long) ((ularge.QuadPart - epoch) / 10000000L);
    tp->tv_usec = (long) (system_time.wMilliseconds * 1000);

    return 0;
}


Variable Documentation

const unsigned __int64 epoch = UINT64CONST(116444736000000000) [static]

Definition at line 35 of file gettimeofday.c.

Referenced by convert_xid(), GetEpochTime(), and gettimeofday().