Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timing in a script 2

Status
Not open for further replies.

farley99

MIS
Feb 12, 2003
413
US
Hi,

I want to run a php script and then print out, this script excuted in 20 seconds

or if it wont with with a script then a section of the script, something like you queried 2000 records in 15 seconds

how can i do that?
 
When you start the script run a
time();

when you finish the script, or portion of it
run a
time();

Subtract that two.

That'll I believe provide you seconds... (might be milliseconds, but I don't think so.)

-Rob
 
You could:

Set a variable equal to the return of time() ( or microtime() ( at the beginning of your script or script section.

Then do the same with a second variable at the end of the script.

Then subtract the first variable from the second.
Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top