src/package/Support/jasonlewis/resource-watcher/src/JasonLewis/ResourceWatcher/Watcher.php
public function startWatch($interval = 1000000, $timeout = null, Closure $callback = null)
    {
        $this->watching = true;

        $timeWatching = 0;

        while ($this->watching) {
            if (is_callable($callback)) {
                call_user_func($callback, $this);
            }

            usleep($interval);

            $this->tracker->checkTrackings();

            $timeWatching += $interval;

            if (!is_null($timeout) and $timeWatching >= $timeout) {
                $this->stopWatch();
            }
        }
    }
public function startWatch($interval = 1000000, $timeout = null, Closure $callback = null)
    {
        $this->watching = true;

        $timeWatching = 0;

        while ($this->watching) {
            if (is_callable($callback)) {
                call_user_func($callback, $this);
            }

            usleep($interval);

            $this->tracker->checkTrackings();

            $timeWatching += $interval;

            if (!is_null($timeout) and $timeWatching >= $timeout) {
                $this->stopWatch();
            }
        }
    }
public function startWatch ( $ interval = 1000000 , $ timeout = null , Closure $ callback = null ) { $ this -> watching = true ; $ timeWatching = 0 ; while ( $ this -> watching ) { if ( is_callable ( $ callback ) ) { call_user_func ( $ callback , $ this ) ; } usleep ( $ interval ) ; $ this -> tracker -> checkTrackings ( ) ; $ timeWatching += $ interval ; if ( ! is_null ( $ timeout ) and $ timeWatching >= $ timeout ) { $ this -> stopWatch ( ) ; } } }
Start watching for a given interval. The interval and timeout and measured
in microseconds, so 1,000,000 microseconds is equal to 1 second.

@param int      $interval
@param int      $timeout
@param \Closure $callback

@return void
Start watching for a given interval . The interval and timeout and measured in microseconds so 1 000 000 microseconds is equal to 1 second .