From 60b68f0d39b92f329c4156a41866341d982831cb Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 15 Feb 2002 17:06:40 +0000 Subject: * hires.h (hires::usecs): Rename from utime. Accept an argument. * strace.cc (strace::microseconds): Use hires class for calculating times. * sync.h (new_muto): Use NO_COPY explicitly in declaration. * times.cc (gettimeofday): Reflect change in usecs argument. (hires::usecs): Ditto. Changed name from utime. * winsup.h (NO_COPY): Add nocommon attribute to force setting aside space for variable. * regcomp.c (REQUIRE): Add a void cast to bypass a warning. --- winsup/cygwin/times.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/times.cc') diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index a30374a..032e32f 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -155,7 +155,7 @@ extern "C" int gettimeofday(struct timeval *tv, struct timezone *tz) { static hires gtod; - LONGLONG now = gtod.utime (); + LONGLONG now = gtod.usecs (false); if (now == (LONGLONG) -1) return -1; @@ -590,7 +590,7 @@ hires::prime () } LONGLONG -hires::utime () +hires::usecs (bool justdelta) { if (!inited) prime (); @@ -607,7 +607,7 @@ hires::utime () return -1; } - now.QuadPart -= primed_pc.QuadPart; // FIXME: Use round() here? - return primed_ft.QuadPart + (LONGLONG) ((double) now.QuadPart * freq); + now.QuadPart = (LONGLONG) (freq * (double) (now.QuadPart - primed_pc.QuadPart)); + return justdelta ? now.QuadPart : primed_ft.QuadPart + now.QuadPart; } -- cgit v1.1