Session with microtime
| From: | Panquekas | Date: | Thu, 19 Apr 2007 16:32:47 +0000 |
| Subject: | Session with microtime | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-253270@lists.php.net to get a copy of this message | ||
hello,
I'm writting a script where I use the function microtime with sessions and I
have a problem.
This is my code:
if( $_SESSION['uperm'] == '1' ){
$t_start = microtime(1);
}
(....)
if( $_SESSION['uperm'] == '1' ){
$t_end = microtime(1) - $t_start;
$time .= "\n " . '<P>This page was loaded in ' .number_format($t_end, 3) . ' seconds.</P>'; } And when I log with any account (admin or user) is "echoed" to me something like this: "This page was loaded in 1,177,003,846.594 seconds." This is too much because the page isn't loaded in this time. And when I refresh the page it appears: "This page was loaded in 0.012 seconds." Why is this? I can't explain. And this started to appear when I put the "if" to check the user permissions. If I "turn off" the "if" it'll run normally. Can anyone explain why is that? Thanks in advance.