aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/times.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-02-15 17:06:40 +0000
committerChristopher Faylor <me@cgf.cx>2002-02-15 17:06:40 +0000
commit60b68f0d39b92f329c4156a41866341d982831cb (patch)
tree69f77510cf9598ac24985d35427cc5457dcebe8d /winsup/cygwin/times.cc
parentdce87b21e14f3a59d666cfe0a64261703c35d986 (diff)
downloadnewlib-60b68f0d39b92f329c4156a41866341d982831cb.zip
newlib-60b68f0d39b92f329c4156a41866341d982831cb.tar.gz
newlib-60b68f0d39b92f329c4156a41866341d982831cb.tar.bz2
* 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.
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc8
1 files changed, 4 insertions, 4 deletions
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;
}