34 #define NSEC_PER_SEC 1000000000L
58 static inline uint64_t
59 rte_cyclecounter_cycles_to_ns(
struct rte_timecounter *tc, uint64_t cycles)
74 static inline uint64_t
77 uint64_t cycle_delta, ns_offset;
87 ns_offset = rte_cyclecounter_cycles_to_ns(tc, cycle_delta);
93 tc->
nsec += ns_offset;
101 static inline uint64_t
102 rte_timespec_to_ns(
const struct timespec *ts)
104 return ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
110 static inline struct timespec
111 rte_ns_to_timespec(uint64_t nsec)
113 struct timespec ts = {0, 0};
118 ts.tv_sec = nsec / NSEC_PER_SEC;
119 ts.tv_nsec = nsec % NSEC_PER_SEC;