I have a web site I am working on that downloads pages of different sizes.

Can anyone tell me the points in the code where I need to get time to allow me to tell how long the server took to serve the page and also how long it took the users end to recieve it.

I am currently taking time at the very beginning and end of the code and calling it the server time.

I am also taking the last time off the prior page and the beginning time off the current page and calling it the network time for the prior page.

Am I way off on my stats or calling them the wrong thing?

Thanks for any help

    There are many many approaches to this problem, this is probably the simplest:

    1. store start time
    2. fopen() the file
    3. output apropriate headers
    4. fpassthru() the file
    5. subtract the start time from the current time
    6. store the time result somewhere apropriate

      Sir,

      Do you have any samples of what I my code may look like. I am new to PHP, but am fairly familiar to networking. I have problems with the help files making sense. I basically am not sure what is going on when I do the fopen and the fpassthru. Are these actions taking place on the server, client or both.

      Thanks for your patience

        Perhaps you should post your question to the newbies board. There is excellent help available there for people who are just learning the language. Please don't be discouraged, PHP is a large and complex language with many quirks and oddities. It will take time a patience. Good luck!

          Write a Reply...