High resolution timing is frequently used in PHP to delay, postpone or filter various actions. The example below shows how to do so.

Simple example with usleep function in PHP

<?php
    usleep(10); // 10 microsecond
    $time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]; // server time
    echo "Sleep time is: " . $time . " seconds.";
?>

 

›› go to examples ››