
I was wondering if there is a easy way to print the servers current date & time in real time for inclusion in a titlebar?
<{$xoops_footer}>
tag on the end to space it out a bit. So after I added the code it looked like this;
Quote:
<{$xoops_footer}><{php}>global $ftime;
echo"This page is loaded in $ftime seconds.";
<{/php}>
tag) . I also tried putting the code into the footer (as this is where I was wanting it anyway), and all it seems to do was print the entire code to screen. I tried making an adaption to suit my needs;
Quote:
This page loaded in php global $ftime; echo $ftime; ?> seconds
This prints correctly at in the footer, except the actual load time is absent as when I replace $ftime with text such as hello, the text is displayed, so I assume I'm missing something to get the $ftime value to print.
I also made the other code changes you specified. One thing I was wondering is what kicks off the time log? Would I have to include something like
Quote:
$xoopsLogger->startTime();
in the header.php to start the time logging process?
Thanks again
/**
* get the current execution time of a timer
*
* @param string $name name of the counter
* @return float current execution time of the counter
*/
function dumpTime($name = 'XOOPS')
{
if (!isset($this->logstart[$name])) {
return 0;
}
if (!isset($this->logend[$name])) {
$stop_time = explode(' ', microtime());
} else {
$stop_time = $this->logend[$name];
}
return ((float)$stop_time[1] + (float)$stop_time[0]) - ((float)$this->logstart[$name][1] + (float)$this->logstart[$name][0]);
}