11 #define NSEC_PER_SEC 1000000000L
35 static inline uint64_t
36 rte_cyclecounter_cycles_to_ns(
struct rte_timecounter *tc, uint64_t cycles)
51 static inline uint64_t
54 uint64_t cycle_delta, ns_offset;
64 ns_offset = rte_cyclecounter_cycles_to_ns(tc, cycle_delta);
70 tc->
nsec += ns_offset;
78 static inline uint64_t
79 rte_timespec_to_ns(
const struct timespec *ts)
81 return ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
87 static inline struct timespec
88 rte_ns_to_timespec(uint64_t nsec)
90 struct timespec ts = {0, 0};
95 ts.tv_sec = nsec / NSEC_PER_SEC;
96 ts.tv_nsec = nsec % NSEC_PER_SEC;