RE: [PHP-DB] timer

From: Date: Tue, 11 Jun 2002 17:24:06 +0000
Subject: RE: [PHP-DB] timer
Groups: php.db 
Request: Send a blank email to php-db+get-19752@lists.php.net to get a copy of this message
oopsss... I should put the getmicrotime() function... sorry, here it is: function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } -----Original Message----- From: Ryan Jameson (USA) Sent: Tuesday, June 11, 2002 11:22 AM To: php-db@lists.php.net Subject: RE: [PHP-DB] timer Just set one variable $var1=time(); before you call mysql_query and then subtract it from time(); after the query. That will be the number of seconds. If you need better precision you can use milliseconds too: $t1 = getmicrotime(); $result_query = mysql_query($query_prism); echo "<hr>Execution Time: " . (getmicrotime()-$t1) . " seconds"; <>< Ryan -----Original Message----- From: Natividad Castro [mailto:ncastro@cots.com] Sent: Tuesday, June 11, 2002 11:27 AM To: php-db@lists.php.net Subject: [PHP-DB] timer hi to all, how can I set up a timer that will tell me how long a query takes to run. for example, if I run the following query, I would like to know how long it takes. $query_prism = "INSERT INTO prism_rec_status(prism_rec_id) select 150bk.ID from 150bk WHERE PHY_ST='IN' Or PHY_ST='OR' Or PHY_ST='PA' Or PHY_ST='IA' Or PHY_ST='MN' Or PHY_ST='CO' Or PHY_ST='ME' Or PHY_ST='TN' Or PHY_ST='GA'"; $result_query = mysql_query($query_prism); Is that possible in php?? Thanks in advanced Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#19752) next »