Last active
September 2, 2016 11:36
-
-
Save Lammerink/3925132 to your computer and use it in GitHub Desktop.
PHP : Generated in X Seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Generated in X Seconds Helper | |
//Put this at the top of the script | |
$time = microtime(); | |
$time = explode(' ', $time); | |
$time = $time[1] + $time[0]; | |
$start = $time; | |
?> | |
<?php | |
//To show "Ganerated in X Seconds" | |
$time = microtime(); | |
$time = explode(' ', $time); | |
$time = $time[1] + $time[0]; | |
$finish = $time; | |
$total_time = round(($finish - $start), 4); | |
echo "</br> Page generated in $total_time seconds.\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
Page generated in 1472815903.7429 seconds
How can I do "X seconds" for humans ?