Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13472 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21766 invoked by uid 1010); 22 Oct 2004 20:43:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20677 invoked from network); 22 Oct 2004 20:43:22 -0000 Received: from unknown (HELO prohost.org) (216.126.86.27) by pb1.pair.com with SMTP; 22 Oct 2004 20:43:22 -0000 Received: (qmail 8167 invoked from network); 22 Oct 2004 20:43:17 -0000 Received: from cpe0050bad46dce-cm000f9f7d6664.cpe.net.cable.rogers.com (HELO ?192.168.1.101?) (@69.196.31.138) by prohost.org with SMTP; 22 Oct 2004 20:43:17 -0000 Message-ID: <417970E3.7080001@prohost.org> Date: Fri, 22 Oct 2004 16:43:15 -0400 User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: PHP 5.1 time() caching From: ilia@prohost.org (Ilia Alshanetsky) As of PHP 5.1, the request start time is stored by PHP inside the sapi structure. This data is populated by the information offered by the SAPI (Apache sapis populate it) otherwise time(0) is used to get the same data. This means that PHP has a "free" unix timestamp that tells information about the request start time, which does not require a syscall. . Since a lot of script end up having to fetch request start time, this can be used to save on a timing call (This information only has second precision, no microseconds). The question is what would be the best way to provide this information within the script. The two alternatives are: adding a new function to get this info or storing this data inside $_SERVER. What do you think? Ilia