Code Snippet </> Info
Snippet Name: Page Processed Time
Description: Show how long it takes to load a pages content.
Note:
Author: Steve Gricci
Last Modified: 2015-08-26 23:47:55
Language: php
Highlight Mode: phphtml
|
Copy Codes: Use Free Notepad ++ |
|
Snap HTML Code Editor: Paste the source code, make changes and instantly see it in live preview. Snap HTML Code Editor
|
|
Copied To Clipboard!
<!DOCTYPE html>
<html>
<head>
<title>Page Processed Time</title>
<style>
#process {
width:400px;
font-family:verdana,arial,ms sans serif;
font-size:90%;
background-color:#e6e6e6;
padding:10px 10px 10px 10px;
box-shadow:0 0 6px rgba(0, 0, 0, 0.5);
-moz-box-shadow:0 0 6px rgba(0, 0, 0, 0.5);
-webkit-box-shadow:0 0 6px rgba(0, 0, 0, 0.5);
</style>
</head>
<body>
<div id="process">
<?php
// Begin Page Processed Time
// == This Script Free To Use Providing This Notice Remains ==
// == This Script Has Been Found In The http://snapbuilder.com Free Public Codes Library ==
// == NOTICE: Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply ==
// by Steve Gricci
// put at beginning of file
function utime (){
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}
$start = utime();
// put at end of page before /body and /html tags
$end = utime(); $run = $end - $start; echo "Page processed in " . substr($run, 0, 5) . " secs.";
// End
?>
</div>
</body>
</html>
|