Macros | Functions
include/grpc/support/time.h File Reference
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <time.h>
#include <grpc/impl/codegen/gpr_types.h>
Include dependency graph for include/grpc/support/time.h:

Go to the source code of this file.

Macros

#define GPR_MS_PER_SEC   1000
 
#define GPR_NS_PER_MS   1000000
 
#define GPR_NS_PER_SEC   1000000000
 
#define GPR_NS_PER_US   1000
 
#define GPR_US_PER_MS   1000
 
#define GPR_US_PER_SEC   1000000
 

Functions

GPRAPI gpr_timespec gpr_convert_clock_type (gpr_timespec t, gpr_clock_type clock_type)
 
GPRAPI gpr_timespec gpr_inf_future (gpr_clock_type type)
 
GPRAPI gpr_timespec gpr_inf_past (gpr_clock_type type)
 
GPRAPI gpr_timespec gpr_now (gpr_clock_type clock)
 
GPRAPI void gpr_sleep_until (gpr_timespec until)
 
GPRAPI gpr_timespec gpr_time_0 (gpr_clock_type type)
 
GPRAPI gpr_timespec gpr_time_add (gpr_timespec a, gpr_timespec b)
 
GPRAPI int gpr_time_cmp (gpr_timespec a, gpr_timespec b)
 
GPRAPI gpr_timespec gpr_time_from_hours (int64_t h, gpr_clock_type clock_type)
 
GPRAPI gpr_timespec gpr_time_from_micros (int64_t us, gpr_clock_type clock_type)
 
GPRAPI gpr_timespec gpr_time_from_millis (int64_t ms, gpr_clock_type clock_type)
 
GPRAPI gpr_timespec gpr_time_from_minutes (int64_t m, gpr_clock_type clock_type)
 
GPRAPI gpr_timespec gpr_time_from_nanos (int64_t ns, gpr_clock_type clock_type)
 
GPRAPI gpr_timespec gpr_time_from_seconds (int64_t s, gpr_clock_type clock_type)
 
GPRAPI void gpr_time_init (void)
 
GPRAPI gpr_timespec gpr_time_max (gpr_timespec a, gpr_timespec b)
 
GPRAPI gpr_timespec gpr_time_min (gpr_timespec a, gpr_timespec b)
 
GPRAPI int gpr_time_similar (gpr_timespec a, gpr_timespec b, gpr_timespec threshold)
 
GPRAPI gpr_timespec gpr_time_sub (gpr_timespec a, gpr_timespec b)
 
GPRAPI int32_t gpr_time_to_millis (gpr_timespec timespec)
 
GPRAPI double gpr_timespec_to_micros (gpr_timespec t)
 

Macro Definition Documentation

◆ GPR_MS_PER_SEC

#define GPR_MS_PER_SEC   1000

The far past.

Definition at line 39 of file include/grpc/support/time.h.

◆ GPR_NS_PER_MS

#define GPR_NS_PER_MS   1000000

Definition at line 42 of file include/grpc/support/time.h.

◆ GPR_NS_PER_SEC

#define GPR_NS_PER_SEC   1000000000

Definition at line 41 of file include/grpc/support/time.h.

◆ GPR_NS_PER_US

#define GPR_NS_PER_US   1000

Definition at line 43 of file include/grpc/support/time.h.

◆ GPR_US_PER_MS

#define GPR_US_PER_MS   1000

Definition at line 44 of file include/grpc/support/time.h.

◆ GPR_US_PER_SEC

#define GPR_US_PER_SEC   1000000

Definition at line 40 of file include/grpc/support/time.h.

Function Documentation

◆ gpr_convert_clock_type()

GPRAPI gpr_timespec gpr_convert_clock_type ( gpr_timespec  t,
gpr_clock_type  clock_type 
)

Convert a timespec from one clock to another

Definition at line 241 of file src/core/lib/gpr/time.cc.

◆ gpr_inf_future()

GPRAPI gpr_timespec gpr_inf_future ( gpr_clock_type  type)

The zero time interval.

Definition at line 55 of file src/core/lib/gpr/time.cc.

◆ gpr_inf_past()

GPRAPI gpr_timespec gpr_inf_past ( gpr_clock_type  type)

The far future

Definition at line 63 of file src/core/lib/gpr/time.cc.

◆ gpr_now()

GPRAPI gpr_timespec gpr_now ( gpr_clock_type  clock)

Return the current time measured from the given clocks epoch.

◆ gpr_sleep_until()

GPRAPI void gpr_sleep_until ( gpr_timespec  until)

Sleep until at least 'until' - an absolute timeout

◆ gpr_time_0()

GPRAPI gpr_timespec gpr_time_0 ( gpr_clock_type  type)

Time constants.

Definition at line 47 of file src/core/lib/gpr/time.cc.

◆ gpr_time_add()

GPRAPI gpr_timespec gpr_time_add ( gpr_timespec  a,
gpr_timespec  b 
)

Add and subtract times. Calculations saturate at infinities.

Definition at line 135 of file src/core/lib/gpr/time.cc.

◆ gpr_time_cmp()

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 at line 30 of file src/core/lib/gpr/time.cc.

◆ gpr_time_from_hours()

GPRAPI gpr_timespec gpr_time_from_hours ( int64_t  h,
gpr_clock_type  clock_type 
)

Definition at line 131 of file src/core/lib/gpr/time.cc.

◆ gpr_time_from_micros()

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. INT64_MIN is interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future.

Definition at line 115 of file src/core/lib/gpr/time.cc.

◆ gpr_time_from_millis()

GPRAPI gpr_timespec gpr_time_from_millis ( int64_t  ms,
gpr_clock_type  clock_type 
)

Definition at line 119 of file src/core/lib/gpr/time.cc.

◆ gpr_time_from_minutes()

GPRAPI gpr_timespec gpr_time_from_minutes ( int64_t  m,
gpr_clock_type  clock_type 
)

Definition at line 127 of file src/core/lib/gpr/time.cc.

◆ gpr_time_from_nanos()

GPRAPI gpr_timespec gpr_time_from_nanos ( int64_t  ns,
gpr_clock_type  clock_type 
)

Definition at line 111 of file src/core/lib/gpr/time.cc.

◆ gpr_time_from_seconds()

GPRAPI gpr_timespec gpr_time_from_seconds ( int64_t  s,
gpr_clock_type  clock_type 
)

Definition at line 123 of file src/core/lib/gpr/time.cc.

◆ gpr_time_init()

GPRAPI void gpr_time_init ( void  )

initialize time subsystem

◆ gpr_time_max()

GPRAPI gpr_timespec gpr_time_max ( gpr_timespec  a,
gpr_timespec  b 
)

Definition at line 43 of file src/core/lib/gpr/time.cc.

◆ gpr_time_min()

GPRAPI gpr_timespec gpr_time_min ( gpr_timespec  a,
gpr_timespec  b 
)

Definition at line 39 of file src/core/lib/gpr/time.cc.

◆ gpr_time_similar()

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 at line 206 of file src/core/lib/gpr/time.cc.

◆ gpr_time_sub()

GPRAPI gpr_timespec gpr_time_sub ( gpr_timespec  a,
gpr_timespec  b 
)

Definition at line 168 of file src/core/lib/gpr/time.cc.

◆ gpr_time_to_millis()

GPRAPI int32_t gpr_time_to_millis ( gpr_timespec  timespec)

Definition at line 221 of file src/core/lib/gpr/time.cc.

◆ gpr_timespec_to_micros()

GPRAPI double gpr_timespec_to_micros ( gpr_timespec  t)

Definition at line 237 of file src/core/lib/gpr/time.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:34