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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server CPU usage

Status
Not open for further replies.

flea333

Technical User
Sep 4, 2003
47
0
0
US
I want to know how much cpu time it takes the server to read files off the a directory. Basically I want to know if it takes a lot of server time to load all the file names using readdir() because I run it every time this page loads, which is meant to be a lot.
 
To the best of my knowledge, there is no builtin PHP function for doing that. You're likely going to have to invoke system functions or apps to do this. Getting this number can be complicated if you're running PHP as a web server module, as the CPU usage for this script will be included in the CPU usage of the web server.

On most systems, though, you have the ability to run a PHP script using a standalone interpreter. You might be able to get your numbers from that.


You might try using glob() instead of opendir() and readdir().




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top