- microtime: documentation ( source)
- ceil: documentation ( source)
- log: documentation ( source)
<?php
$x = 129;
$y = 1;
$m = microtime(true);
$y = 1 << ceil(log($x, 2));
echo microtime(true), "\n\r";
$y = 1;
$m = microtime(true);
while ($y < $x) {
$y = $y <<1;
}
echo microtime(true) - $m;