mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Swap sign of returned time on 32-bit systems
This commit is contained in:
parent
5dcdd83959
commit
a4fd818e13
@ -61,8 +61,10 @@ function getCurrentTime(): int
|
|||||||
{
|
{
|
||||||
if (\PHP_VERSION_ID >= 70300) {
|
if (\PHP_VERSION_ID >= 70300) {
|
||||||
list($seconds, $nanoseconds) = \hrtime(false);
|
list($seconds, $nanoseconds) = \hrtime(false);
|
||||||
return $seconds * 1000 + $nanoseconds / 1000000;
|
$time = (int) ($seconds * 1000 + $nanoseconds / 1000000);
|
||||||
|
} else {
|
||||||
|
$time = (int) (\microtime(true) * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int) (\microtime(true) * 1000);
|
return $time < 0 ? -$time : $time;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user