* hires.h (hires_base::reset): New function.
(hires_us): Specify that hires_base is a public import. (hires_ms): Ditto. * times.cc (gtod): Move earlier in file. (settimeofday): Reset gtod so that base will be subsequently recalculated.
This commit is contained in:
@@ -28,6 +28,8 @@ details. */
|
||||
#define FACTOR (0x19db1ded53e8000LL)
|
||||
#define NSPERSEC 10000000LL
|
||||
|
||||
hires_ms NO_COPY gtod;
|
||||
|
||||
static inline LONGLONG
|
||||
systime_ns ()
|
||||
{
|
||||
@@ -116,6 +118,7 @@ settimeofday (const struct timeval *tv, const struct timezone *tz)
|
||||
st.wMilliseconds = tv->tv_usec / 1000;
|
||||
|
||||
res = !SetSystemTime (&st);
|
||||
gtod.reset ();
|
||||
|
||||
syscall_printf ("%d = settimeofday (%x, %x)", res, tv, tz);
|
||||
|
||||
@@ -146,8 +149,6 @@ totimeval (struct timeval *dst, FILETIME *src, int sub, int flag)
|
||||
dst->tv_sec = x / (long long) (1e6);
|
||||
}
|
||||
|
||||
hires_ms NO_COPY gtod;
|
||||
|
||||
/* FIXME: Make thread safe */
|
||||
extern "C" int
|
||||
gettimeofday (struct timeval *tv, void *tzvp)
|
||||
|
Reference in New Issue
Block a user