GRPC PHP  1.62.0
Public Member Functions | Static Public Member Functions
Grpc\Timeval Class Reference

class Timeval More...

Public Member Functions

 __construct ($microseconds)
 Constructs a new instance of the Timeval class. More...
 
 add ($other_obj)
 Adds another Timeval to this one and returns the sum. More...
 
 subtract ($other_obj)
 Subtracts another Timeval from this one and returns the difference. More...
 
 sleepUntil ()
 Sleep until this time, interpreted as an absolute timeout. More...
 

Static Public Member Functions

static compare ($a_obj, $b_obj)
 Return negative, 0, or positive according to whether a < b, a == b, or a > b respectively. More...
 
static similar ($a_obj, $b_obj, $thresh_obj)
 Checks whether the two times are within $threshold of each other. More...
 
static now ()
 Returns the current time as a timeval object. More...
 
static zero ()
 Returns the zero time interval as a timeval object. More...
 
static infFuture ()
 Returns the infinite future time value as a timeval object. More...
 
static infPast ()
 Returns the infinite past time value as a timeval object. More...
 

Detailed Description

class Timeval

See also
https://github.com/grpc/grpc/tree/master/src/php/ext/grpc/timeval.c

Constructor & Destructor Documentation

◆ __construct()

Grpc\Timeval::__construct (   $microseconds)

Constructs a new instance of the Timeval class.

Parameters
number$microsecondsThe number of microseconds in the interval

Member Function Documentation

◆ add()

Grpc\Timeval::add (   $other_obj)

Adds another Timeval to this one and returns the sum.

Calculations saturate at infinities.

Parameters
Timeval$other_objThe other Timeval object to add
Returns
Timeval A new Timeval object containing the sum

◆ compare()

static Grpc\Timeval::compare (   $a_obj,
  $b_obj 
)
static

Return negative, 0, or positive according to whether a < b, a == b, or a > b respectively.

Parameters
Timeval$a_objThe first time to compare
Timeval$b_objThe second time to compare
Returns
long

◆ infFuture()

static Grpc\Timeval::infFuture ( )
static

Returns the infinite future time value as a timeval object.

Returns
Timeval Infinite future time value

◆ infPast()

static Grpc\Timeval::infPast ( )
static

Returns the infinite past time value as a timeval object.

Returns
Timeval Infinite past time value

◆ now()

static Grpc\Timeval::now ( )
static

Returns the current time as a timeval object.

Returns
Timeval The current time

◆ similar()

static Grpc\Timeval::similar (   $a_obj,
  $b_obj,
  $thresh_obj 
)
static

Checks whether the two times are within $threshold of each other.

Parameters
Timeval$a_objThe first time to compare
Timeval$b_objThe second time to compare
Timeval$thresh_objThe threshold to check against
Returns
bool True if $a and $b are within $threshold, False otherwise

◆ sleepUntil()

Grpc\Timeval::sleepUntil ( )

Sleep until this time, interpreted as an absolute timeout.

Returns
void

◆ subtract()

Grpc\Timeval::subtract (   $other_obj)

Subtracts another Timeval from this one and returns the difference.

Calculations saturate at infinities.

Parameters
Timeval$other_objThe other Timeval object to subtract
Returns
Timeval A new Timeval object containing the diff

◆ zero()

static Grpc\Timeval::zero ( )
static

Returns the zero time interval as a timeval object.

Returns
Timeval Zero length time interval

The documentation for this class was generated from the following file: