40 #pragma GCC visibility push(default)
47 typedef odp_time_t env_time_t;
50 #define ENV_TIME_NULL ODP_TIME_NULL
52 #define ENV_TIME_MSEC_IN_NS ODP_TIME_MSEC_IN_NS
60 static inline env_time_t env_time_local(
void)
62 return odp_time_local();
71 static inline env_time_t env_time_global(
void)
73 return odp_time_global();
84 static inline env_time_t env_time_diff(env_time_t time2, env_time_t time1)
86 return odp_time_diff(time2, time1);
97 static inline uint64_t env_time_diff_ns(env_time_t time2, env_time_t time1)
99 return odp_time_diff_ns(time2, time1);
110 static inline env_time_t env_time_sum(env_time_t time1, env_time_t time2)
112 return odp_time_sum(time1, time2);
122 static inline env_time_t env_time_local_from_ns(uint64_t ns)
124 return odp_time_local_from_ns(ns);
134 static inline env_time_t env_time_global_from_ns(uint64_t ns)
136 return odp_time_global_from_ns(ns);
149 static inline int env_time_cmp(env_time_t time2, env_time_t time1)
151 return odp_time_cmp(time2, time1);
161 static inline uint64_t env_time_to_ns(env_time_t time)
163 return odp_time_to_ns(time);
174 #ifdef __SIZEOF_INT128__
176 static inline uint64_t env_time_to_cycles(env_time_t time, uint64_t hz)
180 cycles = (__uint128_t)odp_time_to_ns(time) * hz / 1000000000;
181 return (uint64_t)cycles;
184 static inline uint64_t env_time_to_cycles(env_time_t time, uint64_t hz)
186 return odp_time_to_ns(time) * (hz / 1000000) / 1000;
190 static inline void env_time_wait_ns(uint64_t ns)
192 odp_time_wait_ns(ns);
199 #pragma GCC visibility pop