8 #ifndef __SOLAR_CAPTURE_TIME_H__
9 #define __SOLAR_CAPTURE_TIME_H__
30 const struct timespec* time);
72 struct timespec* ts_out);
81 return (uint64_t) ts->tv_sec * 1000000000 + ts->tv_nsec;
91 return (uint64_t) tv->tv_sec * 1000000000 + (uint64_t) tv->tv_usec * 1000;
static uint64_t sc_ns_from_us(uint64_t us)
Convert microseconds to nanoseconds.
Definition: time.h:111
int sc_timer_get_expiry_time(const struct sc_callback *cb, struct timespec *ts_out)
Return the expiry time of a timer callback.
void sc_timer_push_back_ns(struct sc_callback *cb, int64_t delta_ns)
Push the expiry time further into the future.
static uint64_t sc_ns_from_tv(const struct timeval *tv)
Convert a timeval struct to nanoseconds.
Definition: time.h:89
static uint64_t sc_ns_from_ts(const struct timespec *ts)
Convert a timespec struct to nanoseconds.
Definition: time.h:79
static uint64_t sc_ns_from_ms(uint64_t ms)
Convert milliseconds to nanoseconds.
Definition: time.h:100
A callback object.
Definition: event.h:33
void sc_timer_expire_at(struct sc_callback *cb, const struct timespec *time)
Request a callback at a given time.
void sc_timer_expire_after_ns(struct sc_callback *cb, int64_t delta_ns)
Request a callback in the future.