Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 5 of 5

This is a discussion on Generating time in the Shared & Semi-Dedicated forum
I want to know how long it takes to generate a html file. Is there a specific function for that? I can also measure the ...

  1. #1
    Around to haunt and taunt
    Join Date
    Feb 2002
    Location
    Netherlands
    Posts
    14

    Generating time

    I want to know how long it takes to generate a html file. Is there a specific function for that? I can also measure the time at the start of the generating process and then again at the end, but i was wondering if there is a function for it in PHP. Couldn't find it on php.net....
    sjonger:::

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    The most common way to do this is with microtime(). It is more accurate than using regular time functions because it measures to fractions of a second instead of just whole seconds like most of the time functions do. I believe php.net has an example for doing what you want, but basically, you call microtime() at the begining of the script and save the value into a variable ($start). Then you do your processing and call microtime() again ($end) and compare the two values.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I might mention that page generation times have very little to do with the display of same. Display times actually depend on the speed of your internet connect as well as the hardware configuration of your PC, especially your graphic card and processor speed.

    Go look at my site, for instance. Page generation time of the homepage is usually in the .3 to .7 second range, however, it will take considerably longer than that for the page to display on most computers because of the graphic content on it, no pun intended.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  4. #4
    Around to haunt and taunt
    Join Date
    Feb 2002
    Location
    Netherlands
    Posts
    14
    I am well aware of that Vin, I already managed to do it with microtime. It is just for fun, i don't need it for any serious business, so it doesn't have to be perfectly accurate or anything....
    sjonger:::

  5. #5
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Would an average over time of this provide a reasonable way to measure per page server load?

    I.e. a way to find out what pages / page-generation constructs are particularly taxing on the server, given that we can't see the actual stats like CPU- en memory usage.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •