40 #define NSEC_PER_SEC 1000000000L
64 static inline uint64_t
65 rte_cyclecounter_cycles_to_ns(
struct rte_timecounter *tc, uint64_t cycles)
80 static inline uint64_t
83 uint64_t cycle_delta, ns_offset;
93 ns_offset = rte_cyclecounter_cycles_to_ns(tc, cycle_delta);
99 tc->
nsec += ns_offset;
107 static inline uint64_t
108 rte_timespec_to_ns(
const struct timespec *ts)
110 return ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
116 static inline struct timespec
117 rte_ns_to_timespec(uint64_t nsec)
119 struct timespec ts = {0, 0};
124 ts.tv_sec = nsec / NSEC_PER_SEC;
125 ts.tv_nsec = nsec % NSEC_PER_SEC;