* Convert from nanosecond units into timespec structure. */
| 89 | * Convert from nanosecond units into timespec structure. |
| 90 | */ |
| 91 | static inline struct timespec |
| 92 | rte_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 | } |
no outgoing calls
no test coverage detected