Skip to content

Commit 875a31a

Browse files
committedApr 24, 2019
Make GeNERATIONTiMED use milliseconds
1 parent db6a9a6 commit 875a31a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎example/templates/footer.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<footer>
2-
<p>Page generated in <?=$GT()?>s.</p>
2+
<p>Page generated in <?=$GT()?>ms.</p>
33
</footer>

‎src/GeNERATIONTiMED.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ function __construct($decimalPlaces = 2)
2626
}
2727

2828
/*
29-
* @returns float How much time has passed (in sec) since the page has been requested
29+
* @returns float How much time has passed (in msec) since the page has been requested
3030
*/
3131
function calcPageGenerationTime()
3232
{
33-
return round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], $this->decimalPlaces);
33+
return round((microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']) * 1000, $this->decimalPlaces);
3434
}
3535

3636
/*
37-
* Binds the calcPageGenerationTime to the passed ViEWD
37+
* Binds calcPageGenerationTime to the passed ViEWD
3838
* @param ViEWD $viewd ViEWD to bind the function to
3939
* @param string $name Name of the template variable to bind the function to
4040
*/

0 commit comments

Comments
 (0)
Please sign in to comment.