TimeInterface
interface TimeInterface (View source)
Defines an interface for obtaining system time.
Methods
Returns the timestamp for the current request.
Returns the timestamp for the current request with microsecond precision.
Returns the current system time as an integer.
Returns the current system time with microsecond precision.
Details
int
getRequestTime()
Returns the timestamp for the current request.
This method should be used to obtain the current system time at the start of the request. It will be the same value for the life of the request (even for long execution times).
If the request is not available it will fallback to the current system time.
This method can replace instances of
float
getRequestMicroTime()
Returns the timestamp for the current request with microsecond precision.
This method should be used to obtain the current system time, with microsecond precision, at the start of the request. It will be the same value for the life of the request (even for long execution times).
If the request is not available it will fallback to the current system time with microsecond precision.
This method can replace instances of
int
getCurrentTime()
Returns the current system time as an integer.
This method should be used to obtain the current system time, at the time the method was called.
This method can replace many instances of
float
getCurrentMicroTime()
Returns the current system time with microsecond precision.
This method should be used to obtain the current system time, with microsecond precision, at the time the method was called.
This method can replace many instances of