MCPcopy Create free account
hub / github.com/ElementsProject/lightning / time_from_usec

Function time_from_usec

ccan/ccan/time/time.h:645–652  ·  view source on GitHub ↗

* time_from_usec - convert microseconds to a relative time * @usec: time in microseconds * * Example: * // 1/2 second timeout * #define TIMEOUT time_from_usec(500000) */

Source from the content-addressed store, hash-verified

643 * #define TIMEOUT time_from_usec(500000)
644 */
645static 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

Callers 5

init_connFunction · 0.85
timemono_from_usecFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
try_connectFunction · 0.85

Calls

no outgoing calls

Tested by 4

init_connFunction · 0.68
timemono_from_usecFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68