本文整理汇总了PHP中Timer::getInterval方法的典型用法代码示例。如果您正苦于以下问题:PHP Timer::getInterval方法的具体用法?PHP Timer::getInterval怎么用?PHP Timer::getInterval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::getInterval方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
/**
* {@inheritdoc}
*/
public function start(Timer $timer)
{
if (!isset($this->timers[$timer])) {
$interval = $timer->getInterval();
$event = $this->loop->timer($interval, $timer->isPeriodic() ? $interval : 0, $this->callback, $timer);
$this->timers[$timer] = $event;
}
}
示例2: start
/**
* {@inheritdoc}
*/
public function start(Timer $timer)
{
if (!isset($this->timers[$timer])) {
$handle = \uv_timer_init($this->loopHandle);
$interval = $timer->getInterval() * self::MILLISEC_PER_SEC;
\uv_timer_start($handle, $interval, $timer->isPeriodic() ? $interval : 0, $this->callback);
$this->timers[$timer] = $handle;
$this->handles[(int) $handle] = $timer;
}
}
示例3: start
/**
* {@inheritdoc}
*/
public function start(Timer $timer)
{
$flags = Event::TIMEOUT;
if ($timer->isPeriodic()) {
$flags |= Event::PERSIST;
}
$event = new Event($this->base, -1, $flags, $this->callback, $timer);
$this->timers[$timer] = $event;
$event->add($timer->getInterval());
}