Board index   FAQ   Search  
Register  Login
Board index PHP PHP General


General discussions related to php

Moderators: macek, egami, gesf

Postby Jay » Thu Oct 24, 2002 2:03 am

The correct way to get the time is:
Code: Select all
list($microseconds,$seconds) = explode(" ",microtime());
$time = $seconds.substr($microseconds,1);

Do this at the start of the page, and at the end to get two different values, take one away from the other to get the page generation time.

To determine how long the user spent on the last page, you have to find out the time the next page is called, and minus from it the time when the original page was generated. It's pretty complicated and leaves you very open for errors!!

Return to PHP General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.