19 #ifndef GRPC_SUPPORT_TIME_H
20 #define GRPC_SUPPORT_TIME_H
39 #define GPR_MS_PER_SEC 1000
40 #define GPR_US_PER_SEC 1000000
41 #define GPR_NS_PER_SEC 1000000000
42 #define GPR_NS_PER_MS 1000000
43 #define GPR_NS_PER_US 1000
44 #define GPR_US_PER_MS 1000
gpr_clock_type
The clocks we support.
Definition: gpr_types.h:31
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
Return the current time measured from the given clocks epoch.
GPRAPI void gpr_time_init(void)
initialize time subsystem
GPRAPI gpr_timespec gpr_time_from_hours(int64_t h, gpr_clock_type clock_type)
Definition: time.cc:130
GPRAPI gpr_timespec gpr_time_0(gpr_clock_type type)
Time constants.
Definition: time.cc:46
GPRAPI double gpr_timespec_to_micros(gpr_timespec t)
Definition: time.cc:235
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
The zero time interval.
Definition: time.cc:54
GPRAPI gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type clock_type)
Definition: time.cc:122
GPRAPI gpr_timespec gpr_time_min(gpr_timespec a, gpr_timespec b)
Definition: time.cc:38
GPRAPI int32_t gpr_time_to_millis(gpr_timespec timespec)
Definition: time.cc:219
GPRAPI gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b)
Definition: time.cc:167
GPRAPI gpr_timespec gpr_time_from_micros(int64_t us, gpr_clock_type clock_type)
Return a timespec representing a given number of time units.
Definition: time.cc:114
GPRAPI int gpr_time_cmp(gpr_timespec a, gpr_timespec b)
Return -ve, 0, or +ve according to whether a < b, a == b, or a > b respectively.
Definition: time.cc:29
GPRAPI gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type clock_type)
Definition: time.cc:118
GPRAPI void gpr_sleep_until(gpr_timespec until)
Sleep until at least 'until' - an absolute timeout.
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
Add and subtract times.
Definition: time.cc:134
GPRAPI gpr_timespec gpr_time_max(gpr_timespec a, gpr_timespec b)
Definition: time.cc:42
GPRAPI gpr_timespec gpr_inf_past(gpr_clock_type type)
The far future.
Definition: time.cc:62
GPRAPI gpr_timespec gpr_time_from_minutes(int64_t m, gpr_clock_type clock_type)
Definition: time.cc:126
GPRAPI int gpr_time_similar(gpr_timespec a, gpr_timespec b, gpr_timespec threshold)
Return 1 if two times are equal or within threshold of each other, 0 otherwise.
Definition: time.cc:204
GPRAPI gpr_timespec gpr_time_from_nanos(int64_t ns, gpr_clock_type clock_type)
Definition: time.cc:110
GPRAPI gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type)
Convert a timespec from one clock to another.
Definition: time.cc:239
Analogous to struct timespec.
Definition: gpr_types.h:47
DiscoveryMechanismType type
Definition: xds_cluster_resolver.cc:73