Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13474 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79062 invoked by uid 1010); 22 Oct 2004 20:57:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78959 invoked from network); 22 Oct 2004 20:57:22 -0000 Received: from unknown (HELO corereactor.com) (217.172.66.21) by pb1.pair.com with SMTP; 22 Oct 2004 20:57:22 -0000 Received: (qmail 28907 invoked from network); 22 Oct 2004 22:56:32 +0200 Received: from unknown (HELO ?127.0.0.1?) (212.106.236.253) by 192.168.0.21 with SMTP; 22 Oct 2004 22:56:32 +0200 Message-ID: <41797423.4060405@dharana.net> Date: Fri, 22 Oct 2004 22:57:07 +0200 User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ilia Alshanetsky CC: internals@lists.php.net References: <417970E3.7080001@prohost.org> In-Reply-To: <417970E3.7080001@prohost.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 5.1 time() caching From: dharana@dharana.net (dharana) Ilia Alshanetsky wrote: > 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). I would think the reason for fetching request start time is to profile execution time (the first line you would see in my scripts is always $time_start = microtime()) or maybe it's just me, of course. > > 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. I'm for $_SERVER, it makes most sense for me. > > What do you think? > > Ilia > -- Juan Alonso http://gamersmafia.com | http://laflecha.net