15 #define NSEC_PER_SEC 1000000000L 39 static inline uint64_t
40 rte_cyclecounter_cycles_to_ns(
struct rte_timecounter *tc, uint64_t cycles)
55 static inline uint64_t
58 uint64_t cycle_delta, ns_offset;
68 ns_offset = rte_cyclecounter_cycles_to_ns(tc, cycle_delta);
74 tc->
nsec += ns_offset;
82 static inline uint64_t
83 rte_timespec_to_ns(
const struct timespec *ts)
85 return ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
91 static inline struct timespec
92 rte_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;