wait() public method

Waits for notification from the Stackable
public wait ( integer $timeout ) : boolean
$timeout integer An optional timeout in microseconds
return boolean A boolean indication of success
Example #1
0
function _sleep($microseconds)
{
    $monitor = new Threaded();
    $monitor->synchronized(function () use($microseconds, $monitor) {
        $monitor->wait($microseconds);
    });
}
Example #2
0
 public static function microSleep(int $microseconds)
 {
     Server::$sleeper->synchronized(function (int $ms) {
         Server::$sleeper->wait($ms);
     }, $microseconds);
 }