diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-06-01 12:33:20 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-07 13:49:27 +0100 |
commit | 025525266f6861437ca54aca2a86eb505a486baf (patch) | |
tree | 8a4f2035ef7edbcd77224ed76598ec0806f24512 /lib/timer.c | |
parent | 28a7d3943ef915c405b3552ae06f639a86f4dc1e (diff) |
Timers: Replace old timers with microsecond timers
The old timer interface is still kept, but implemented by new timers. The
plan is to switch from the old inteface to the new interface, then clean
it up.
Diffstat (limited to 'lib/timer.c')
-rw-r--r-- | lib/timer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/timer.c b/lib/timer.c index 7ca0bdaa..2c08b353 100644 --- a/lib/timer.c +++ b/lib/timer.c @@ -56,6 +56,17 @@ current_time(void) return timeloop_current()->last_time; } +btime +current_real_time(void) +{ + struct timeloop *loop = timeloop_current(); + + if (!loop->real_time) + times_update_real_time(loop); + + return loop->real_time; +} + #define TIMER_LESS(a,b) ((a)->expires < (b)->expires) #define TIMER_SWAP(heap,a,b,t) (t = heap[a], heap[a] = heap[b], heap[b] = t, \ |