RE: [PHP] Performance question
| From: | Jeff Harris | Date: | Wed, 25 Jun 2003 04:39:41 +0000 |
| Subject: | RE: [PHP] Performance question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152700@lists.php.net to get a copy of this message | ||
On Jun 25, 2003, "Ow Mun Heng" claimed that:
|Can someone help explain how I can perform a benchmark on the queries or
|whatever?
|
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|
Do it many times and time it.
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc |
gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
<?
require_once ("Benchmark/Timer.php");
require_once ("DB.php");
$timer = new Benchmark_Timer;
$dblink=DB::connect("mysql://$dbuser:$dbpass@$dbhost/$dbname");
print("starting...<BR>\n");
ob_flush();
$timer->start();
$SQLQuery="SELECT * FROM table";
for ($i = 1; $i <= 1000000000; $i++) {
$insert= $dblink->query($SQLQuery);
}
$timer->stop();
print("Total execution time: ");
print($timer-> timeElapsed());
print(" seconds.\n");
?>