Microtime

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
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!!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest