pluto: Use time_monotonic() instead of a custom implementation.
This commit is contained in:
+1
-12
@@ -46,18 +46,7 @@
|
|||||||
*/
|
*/
|
||||||
time_t now(void)
|
time_t now(void)
|
||||||
{
|
{
|
||||||
static time_t delta = 0
|
return time_monotonic(NULL);
|
||||||
, last_time = 0;
|
|
||||||
time_t n = time(NULL);
|
|
||||||
|
|
||||||
passert(n != (time_t)-1);
|
|
||||||
if (last_time > n)
|
|
||||||
{
|
|
||||||
plog("time moved backwards %ld seconds", (long)(last_time - n));
|
|
||||||
delta += last_time - n;
|
|
||||||
}
|
|
||||||
last_time = n;
|
|
||||||
return n + delta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This file has the event handling routines. Events are
|
/* This file has the event handling routines. Events are
|
||||||
|
|||||||
Reference in New Issue
Block a user