cvs: phpweb /include layout.inc prepend.inc
| From: | Gabor Hojtsy | Date: | Thu, 01 May 2003 12:17:54 +0000 |
| Subject: | cvs: phpweb /include layout.inc prepend.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-17180@lists.php.net to get a copy of this message | ||
goba Thu May 1 08:17:54 2003 EDT
Modified files:
/phpweb/include layout.inc prepend.inc
Log:
Add getmicrotime() and measure page creation
time from prepend.inc to commonFooter()
Remove ending ?> from files for header() safety
reasons
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.137 phpweb/include/layout.inc:1.138
--- phpweb/include/layout.inc:1.137 Sat Apr 26 12:17:55 2003
+++ phpweb/include/layout.inc Thu May 1 08:17:54 2003
@@ -1,6 +1,6 @@
<?php
-/* $Id: layout.inc,v 1.137 2003/04/26 16:17:55 goba Exp $ */
+/* $Id: layout.inc,v 1.138 2003/05/01 12:17:54 goba Exp $ */
// Print an image for a sized spacer
function spacer($width = 1, $height = 1, $return = false, $align = false, $extras = false)
@@ -361,6 +361,7 @@
</body>
</html>
<?php
+ echo "<!-- " . (getmicrotime() - $page_creation_start) . " -->\n";
}
function sect_to_file($string) {
@@ -476,5 +477,3 @@
$t = pow(sin($dlat/2), 2) + cos($lat1)*cos($lat2)*pow(sin($dlon/2),2);
return atan2(sqrt($t),sqrt(1-$t));
}
-
-?>
Index: phpweb/include/prepend.inc
diff -u phpweb/include/prepend.inc:1.20 phpweb/include/prepend.inc:1.21
--- phpweb/include/prepend.inc:1.20 Wed Apr 23 12:51:52 2003
+++ phpweb/include/prepend.inc Thu May 1 08:17:54 2003
@@ -1,6 +1,9 @@
<?php // -*- C++ -*-
-// $Id: prepend.inc,v 1.20 2003/04/23 16:51:52 goba Exp $
+// $Id: prepend.inc,v 1.21 2003/05/01 12:17:54 goba Exp $
+
+// Start measuring time spent on page
+$page_creation_start = getmicrotime();
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
// for cache control header descriptions (used in many places on the site).
@@ -89,4 +92,9 @@
}
}
-?>
+// Utility function used for time measuring
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float) $usec + (float) $sec);
+}