summaryrefslogtreecommitdiffstats
path: root/src/babel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/babel.h')
-rw-r--r--src/babel.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/babel.h b/src/babel.h
index 93a3bcd..0b0b4d4 100644
--- a/src/babel.h
+++ b/src/babel.h
@@ -152,6 +152,13 @@ static inline bool gp_babel_less(uint16_t a, uint16_t b) {
return (diff < 0);
}
+static inline int64_t gp_babel_since(gmrf_context_t *ctx, gmrf_time_t t) {
+ if (t == gmrf_time_unspec)
+ return INT64_MAX;
+
+ return (gmrf_now(ctx->gmrf) - t)/10;
+}
+
static inline bool gp_babel_is_metric_better(gp_babel_metric_seqno_t ms1, gp_babel_metric_seqno_t ms2) {
if (ms1.metric == GP_BABEL_INFINITY)
return false;