|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-01 21:43 UTC] alan_k@php.net
[2002-08-23 22:25 UTC] sniper@php.net
[2002-09-21 02:14 UTC] sniper@php.net
[2005-08-10 13:13 UTC] fredrik at demomusic dot nu
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 21:00:01 2025 UTC |
PHP as a module in Apache!(Apache1.3.24 + PHP4.2.1) <?php // A function that records the time when it is called function profile($dump = FALSE) { static $profile; // Return the times stored in profile, then erase it if ($dump) { $temp = $profile; unset ($profile); return ($temp); } $profile[] = microtime(); } // Set up a tick handler register_tick_function("profile");//here have a bug,but on win32+PHP4.2.1 no problem! // Initialize the function before the declare block profile(); // Run a block of code, throw a tick every 2nd statement declare(ticks=2) { for ($x = 1; $x < 50; ++$x) { echo similar_text (md5($x), md5($x*$x)), "<br>"; } } // Display the data stored in the profiler print_r(profile (TRUE)); ?>