microtime as float (#502)

This commit is contained in:
Michał "Gubihe 2022-01-21 10:28:07 +01:00 committed by GitHub
parent 4fb06fb4e5
commit 6d402cef28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -7,9 +7,8 @@ if (!function_exists("elapsedTime")) {
if ($l_start === false) global $l_start;
if ($l_time === false) global $l_time;
$l_time = explode(' ', microtime());
$l_finish = $l_time[1] + $l_time[0];
return round(($l_finish - $l_start), 4);
$l_time = microtime(true);
return round(($l_time - $l_start), 4);
}
}

View File

@ -1,11 +1,9 @@
<footer>
&copy; Znote AAC.
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = microtime(true);
$finish = $time;
$total_time = round(($finish - $start), 4);
echo 'Server date and clock is: '. getClock(false, true) .' Page generated in '. $total_time .' seconds. ';
?>
</footer>
</footer>

View File

@ -1,8 +1,6 @@
<?php if (version_compare(phpversion(), '5.6', '<')) die('PHP version 5.6 or higher is required.');
$l_time = microtime();
$l_time = explode(' ', $l_time);
$l_time = $l_time[1] + $l_time[0];
$l_time = microtime(true);
$l_start = $l_time;
function elapsedTime($l_start = false, $l_time = false) {