Go to the documentation of this file.
31 int cmp = (
a.tv_sec >
b.tv_sec) - (
a.tv_sec <
b.tv_sec);
34 cmp = (
a.tv_nsec >
b.tv_nsec) - (
a.tv_nsec <
b.tv_nsec);
80 if (time_in_units >= 0) {
81 out.tv_sec = time_in_units / units_per_sec;
83 out.tv_sec = (-((units_per_sec - 1) - (time_in_units + units_per_sec)) /
88 static_cast<int32_t>((time_in_units -
out.tv_sec * units_per_sec) *
99 if (time_in_units >=
INT64_MAX / secs_per_unit) {
101 }
else if (time_in_units <=
INT64_MIN / secs_per_unit) {
104 out.tv_sec = time_in_units * secs_per_unit;
143 sum.clock_type =
a.clock_type;
144 sum.tv_nsec =
a.tv_nsec +
b.tv_nsec;
158 sum.tv_sec =
a.tv_sec +
b.tv_sec;
172 diff.clock_type =
a.clock_type;
181 diff.tv_nsec =
a.tv_nsec -
b.tv_nsec;
182 if (
diff.tv_nsec < 0) {
187 diff.tv_sec =
a.tv_sec;
188 diff.tv_nsec =
a.tv_nsec;
196 diff.tv_sec =
a.tv_sec -
b.tv_sec;
213 if (cmp_ab == 0)
return 1;
222 if (t.tv_sec >= 2147483) {
223 if (t.tv_sec == 2147483 && t.tv_nsec < 648 *
GPR_NS_PER_MS) {
227 }
else if (t.tv_sec <= -2147483) {
238 return static_cast<double>(t.tv_sec) *
GPR_US_PER_SEC + t.tv_nsec * 1e-3;
242 if (t.clock_type == clock_type) {
247 t.clock_type = clock_type;
gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
static gpr_timespec to_seconds_from_sub_second_time(int64_t time_in_units, int64_t units_per_sec, gpr_clock_type type)
gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type)
int gpr_time_similar(gpr_timespec a, gpr_timespec b, gpr_timespec threshold)
double sum(const T &container, F functor)
static gpr_timespec to_seconds_from_above_second_time(int64_t time_in_units, int64_t secs_per_unit, gpr_clock_type type)
gpr_timespec gpr_time_from_minutes(int64_t m, gpr_clock_type clock_type)
gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type clock_type)
gpr_timespec gpr_time_from_micros(int64_t us, gpr_clock_type clock_type)
gpr_timespec gpr_time_from_hours(int64_t h, gpr_clock_type clock_type)
gpr_timespec gpr_inf_future(gpr_clock_type type)
int gpr_time_cmp(gpr_timespec a, gpr_timespec b)
gpr_timespec gpr_time_min(gpr_timespec a, gpr_timespec b)
gpr_timespec gpr_time_from_nanos(int64_t ns, gpr_clock_type clock_type)
gpr_timespec gpr_time_0(gpr_clock_type type)
double gpr_timespec_to_micros(gpr_timespec t)
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
gpr_clock_type clock_type
gpr_timespec gpr_time_max(gpr_timespec a, gpr_timespec b)
gpr_timespec gpr_inf_past(gpr_clock_type type)
int32_t gpr_time_to_millis(gpr_timespec t)
gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b)
gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type clock_type)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:36