* time_from_usec - convert microseconds to a relative time * @usec: time in microseconds * * Example: * // 1/2 second timeout * #define TIMEOUT time_from_usec(500000) */
| 643 | * #define TIMEOUT time_from_usec(500000) |
| 644 | */ |
| 645 | static inline struct timerel time_from_usec(uint64_t usec) |
| 646 | { |
| 647 | struct timerel t; |
| 648 | |
| 649 | t.ts.tv_nsec = (usec % 1000000) * 1000; |
| 650 | t.ts.tv_sec = usec / 1000000; |
| 651 | return TIMEREL_CHECK(t); |
| 652 | } |
| 653 | |
| 654 | /** |
| 655 | * time_from_nsec - convert nanoseconds to a relative time |
no outgoing calls