15#define NSEC_PER_SEC 1000000000L
40rte_cyclecounter_cycles_to_ns(
struct rte_timecounter *tc, uint64_t cycles)
58 uint64_t cycle_delta, ns_offset;
68 ns_offset = rte_cyclecounter_cycles_to_ns(tc, cycle_delta);
74 tc->
nsec += ns_offset;
83rte_timespec_to_ns(
const struct timespec *ts)
85 return ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
91static inline struct timespec
92rte_ns_to_timespec(uint64_t nsec)
94 struct timespec ts = {0, 0};
99 ts.tv_sec = nsec / NSEC_PER_SEC;
100 ts.tv_nsec = nsec % NSEC_PER_SEC;