PDA

View Full Version : PHP Speed Test



phuckedup
March 10th, 2004, 19:11
Hey guys. I'm looking for a php speed test to tell me the time, and avg. speed of an image/file to load. a CGI scripts also ok.
Thanks

Pablo
March 10th, 2004, 19:49
maybe something like this??
http://www.gambitdesign.com/bandwidthmeter/

bloodyveins
March 10th, 2004, 22:09
May be this one??


class Timer {
function startTimer() {
global $start;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$start = $mtime;
}
function endTimer() {
global $start;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$end = $mtime;
$totaltime = round (($end - $start), 3);
return $totaltime;
}
}//End of class



and:


function callFile($pathToFile) {
$tplFp = @fopen($pathToFile,"rb");
$tplContent = @fread($tplFp,filesize($pathToFile));
@fclose($tplFp);
return $tplContent;
}


Usage:


$TIMER = new Timer;
$TIMER->startTimer();
$file = callFile("html/template.html");
print $file;
print "Total time: ".$TIMER->endTimer();

phuckedup
March 11th, 2004, 00:41
Thanks bloodyveins but i'm looking for something that can mainly tell the download speed but thanks anyway. The script pablo suggested looks perfect. Thanks to both of you :classic2: