MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_ns_to_timespec

Function rte_ns_to_timespec

dpdk/lib/eal/include/rte_time.h:91–103  ·  view source on GitHub ↗

* Convert from nanosecond units into timespec structure. */

Source from the content-addressed store, hash-verified

89 * Convert from nanosecond units into timespec structure.
90 */
91static inline struct timespec
92rte_ns_to_timespec(uint64_t nsec)
93{
94 struct timespec ts = {0, 0};
95
96 if (nsec == 0)
97 return ts;
98
99 ts.tv_sec = nsec / NSEC_PER_SEC;
100 ts.tv_nsec = nsec % NSEC_PER_SEC;
101
102 return ts;
103}
104
105#ifdef __cplusplus
106}

Calls

no outgoing calls

Tested by

no test coverage detected