]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
calculate run time from when we last resumed
authorAlan T. DeKok <aland@freeradius.org>
Sun, 22 Dec 2019 16:27:55 +0000 (11:27 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 22 Dec 2019 16:27:55 +0000 (11:27 -0500)
src/lib/io/time_tracking.h

index 929e00fec90068ac4b87f3aa88803f7eb71b44c1..8c68868adbb8c4be026e7c9d128d5085dbc0a044 100644 (file)
@@ -154,7 +154,7 @@ static inline CC_HINT(nonnull) void fr_time_tracking_start(fr_time_tracking_t *p
        ASSERT_ON_TIME_TRAVEL(tt, now);
 
        tt->state = FR_TIME_TRACKING_RUNNING;
-       tt->started = tt->last_changed = now;
+       tt->started = tt->last_changed = tt->last_resumed = now;
 
        tt->parent = parent;
 
@@ -265,7 +265,7 @@ static inline void fr_time_tracking_end(fr_time_delta_t *predicted,
        tt->state = FR_TIME_TRACKING_STOPPED;
        tt->ended = tt->last_changed = now;
 
-       run_time = now - tt->last_changed;
+       run_time = now - tt->last_resumed;
        tt->running_total += run_time;
        UPDATE_PARENT_RUN_TIME(tt, run_time, ended, now);