include/grpc/support/time.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_SUPPORT_TIME_H
20 #define GRPC_SUPPORT_TIME_H
21 
23 
24 #include <stddef.h>
25 #include <time.h>
26 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
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
45 
47 GPRAPI void gpr_time_init(void);
48 
51 
54  gpr_clock_type clock_type);
55 
59 
62 
66 
75 
77 
81  gpr_timespec threshold);
82 
85 
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* GRPC_SUPPORT_TIME_H */
gpr_timespec_to_micros
GPRAPI double gpr_timespec_to_micros(gpr_timespec t)
Definition: src/core/lib/gpr/time.cc:237
gpr_time_similar
GPRAPI int gpr_time_similar(gpr_timespec a, gpr_timespec b, gpr_timespec threshold)
Definition: src/core/lib/gpr/time.cc:206
gpr_time_from_minutes
GPRAPI gpr_timespec gpr_time_from_minutes(int64_t m, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:127
gpr_time_0
GPRAPI gpr_timespec gpr_time_0(gpr_clock_type type)
Definition: src/core/lib/gpr/time.cc:47
GPRAPI
#define GPRAPI
Definition: impl/codegen/port_platform.h:660
gpr_inf_future
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
Definition: src/core/lib/gpr/time.cc:55
time.h
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
gpr_time_from_nanos
GPRAPI gpr_timespec gpr_time_from_nanos(int64_t ns, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:111
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
gpr_time_cmp
GPRAPI int gpr_time_cmp(gpr_timespec a, gpr_timespec b)
Definition: src/core/lib/gpr/time.cc:30
gpr_time_sub
GPRAPI gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b)
Definition: src/core/lib/gpr/time.cc:168
gpr_sleep_until
GPRAPI void gpr_sleep_until(gpr_timespec until)
gpr_time_to_millis
GPRAPI int32_t gpr_time_to_millis(gpr_timespec timespec)
Definition: src/core/lib/gpr/time.cc:221
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
gpr_now
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
gpr_types.h
gpr_inf_past
GPRAPI gpr_timespec gpr_inf_past(gpr_clock_type type)
Definition: src/core/lib/gpr/time.cc:63
gpr_time_max
GPRAPI gpr_timespec gpr_time_max(gpr_timespec a, gpr_timespec b)
Definition: src/core/lib/gpr/time.cc:43
gpr_time_add
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
Definition: src/core/lib/gpr/time.cc:135
gpr_convert_clock_type
GPRAPI gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:241
gpr_time_from_hours
GPRAPI gpr_timespec gpr_time_from_hours(int64_t h, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:131
gpr_time_from_micros
GPRAPI gpr_timespec gpr_time_from_micros(int64_t us, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:115
gpr_time_from_millis
GPRAPI gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:119
ns
static int64_t ns
Definition: bloaty/third_party/re2/util/benchmark.cc:43
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
gpr_timespec
Definition: gpr_types.h:50
regress.m
m
Definition: regress/regress.py:25
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
gpr_time_min
GPRAPI gpr_timespec gpr_time_min(gpr_timespec a, gpr_timespec b)
Definition: src/core/lib/gpr/time.cc:39
gpr_time_init
GPRAPI void gpr_time_init(void)
gpr_time_from_seconds
GPRAPI gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:123
gpr_clock_type
gpr_clock_type
Definition: gpr_types.h:34
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:36