Timeval
class Timeval (View source)
Class Timeval
Methods
Constructs a new instance of the Timeval class
Sleep until this time, interpreted as an absolute timeout
Details
__construct(int $usec)
Constructs a new instance of the Timeval class
Timeval
add(Timeval $other)
Adds another Timeval to this one and returns the sum. Calculations saturate at infinities.
static int
compare(Timeval $a, Timeval $b)
Return negative, 0, or positive according to whether a < b, a == b, or a > b respectively.
static Timeval
infFuture()
Returns the infinite future time value as a timeval object
static Timeval
infPast()
Returns the infinite past time value as a timeval object
static Timeval
now()
Returns the current time as a timeval object
static bool
similar(Timeval $a, Timeval $b, Timeval $threshold)
Checks whether the two times are within $threshold of each other
sleepUntil()
Sleep until this time, interpreted as an absolute timeout
Timeval
subtract(Timeval $other)
Subtracts another Timeval from this one and returns the difference.
Calculations saturate at infinities.
static Timeval
zero()
Returns the zero time interval as a timeval object