blob: 61873bb2ef3c0bac2c487ef4d365d527f2d7171f [file] [log] [blame]
BenoƮt Ganne56eccdb2021-08-20 09:18:31 +02001/*
2 * SPDX-License-Identifier: Apache-2.0
3 * Copyright(c) 2021 Cisco Systems, Inc.
4 */
5
6#ifndef included_vlib_time_h
7#define included_vlib_time_h
8
9#include <vlib/vlib.h>
10#include <vppinfra/tw_timer_1t_3w_1024sl_ov.h>
11
12static inline f64
13vlib_time_get_next_timer (vlib_main_t *vm)
14{
15 vlib_node_main_t *nm = &vm->node_main;
16 TWT (tw_timer_wheel) *wheel = nm->timing_wheel;
17 return TW (tw_timer_first_expires_in_ticks) (wheel) * wheel->timer_interval;
18}
19
20static inline void
21vlib_time_adjust (vlib_main_t *vm, f64 offset)
22{
23 vm->time_offset += offset;
24}
25
26#endif /* included_vlib_time_h */