- usleep: documentation ( source)
- microtime: documentation ( source)
<?php
$time_start = microtime(true);
echo "time_start in $time_start seconds\n";
// Sleep for a while
usleep(1000);
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Did nothing in $time seconds\n";