Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-04-11 23:49:58 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-04-11 23:49:58 +0400
commit8f81761b6997db261137b8f02c8a838b6e5bb15b (patch)
tree287e4d53167de9c1ddbb6a26e6ab0ac093bf867c /winsup/cygwin/times.cc
parent99e6ee04d657800680cced150e200e8b075957ba (diff)
* hires.h (hires_ns::nsecs): Declare with bool parameter.
* times.cc (hires_ns::nsecs): Take bool parameter. If set to true, don't use prime value (== return system wide absolute value).
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 764a49076..407f7c479 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -477,7 +477,7 @@ hires_ns::prime ()
}
LONGLONG
-hires_ns::nsecs ()
+hires_ns::nsecs (bool monotonic)
{
if (!inited)
prime ();
@@ -495,7 +495,8 @@ hires_ns::nsecs ()
}
// FIXME: Use round() here?
- now.QuadPart = (LONGLONG) (freq * (double) (now.QuadPart - primed_pc.QuadPart));
+ now.QuadPart = (LONGLONG) (freq * (double)
+ (now.QuadPart - (monotonic ? 0LL : primed_pc.QuadPart)));
return now.QuadPart;
}
@@ -642,7 +643,7 @@ clock_gettime (clockid_t clk_id, struct timespec *tp)
case CLOCK_MONOTONIC:
{
- LONGLONG now = ntod.nsecs ();
+ LONGLONG now = ntod.nsecs (true);
if (now == (LONGLONG) -1)
return -1;