Re: com php-src: Refactored internal_get_timestamp(): ext/intl/dateformat/dateformat_format.c

From: Date: Sun, 22 Jul 2012 02:50:38 +0000
Subject: Re: com php-src: Refactored internal_get_timestamp(): ext/intl/dateformat/dateformat_format.c
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-61625@lists.php.net to get a copy of this message
Your commit reminded me that we should probably look into providing access to the low-level monotonic clock. eg. CLOCK_MONOTONIC_RAW described here: http://www.kernel.org/doc/man-pages/online/pages/man2/clock_getres.2.html There is a monotonic clock library here that should help with portability: https://github.com/ThomasHabets/monotonic_clock As to why? The leap-second bug is a good example, but in general, anything that schedules events or times soething with fine granularity is going to be wildly inaccurate due to ntp clock drift if the timing source is a regular gettimeofday call. It simply doesn't work reliably for measuring sub-second intervals. If you need to reliably trigger a timeout 10ms from now, you have to use a monotonic clock call. -Rasmus

« previous php.internals (#61625) next »