Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This refactors the internal usages of the current time.
zend_time.h
to be used instead of systemtime.h
zend_realtime_spec
as a wrapper aroundclock_gettime
,timespec_get
,gettimeofday
andtime
using the real/wall clock providing atimespec
with up to nanosecond resolutionzend_realtime_get
as a replacement fortime
but optionally providing nanosecondzend_monotime_fallback
either pointing tozend_hrtime
or wrappingzend_realtime_spec
timeval
andtimespec
zend_realtime_*
/zend_monotime_fallback
timespec
for current time but keeptimeval
as it's needed for file/streamsAs a result:
zend_realtime_get
/zend_realtime_spec
andzend_monotime_fallback
will be available for sure because it falls backclock_gettime
->timespec_get
->gettimeofday
->time
long
oftimeval.tv_sec
should be fixed time() and friends have Y2038 problem on 64 Windows #17856microtime()
/gettimeofday(true)
without BC breakuniqid
refactored a bit to not wait for the next time but increments if the current time is less or equal to the previous call. This should be faster and resolve a theoretical issue if the real time got modified in betweenEven thought
gettimeofday
may not be available it wasn't checked everywhere before and compiling would have been failed already if missing. Availability should now be checked but as it falls back and it must have been available before I removed the conditions aroundmicrotime
,gettimeofday
anduniqid