Орла
Области
Компаний
Пользователи
Галерея
Фиксированные новости
Орла
Отзывы о фирмах
Тарифы
Пользователи
Области
Банкоматы
Торговые точки
Доска объявлений
Курсы валют
Скидки
организации Орла
организации области
товары
сайты
сайты Орел
Данные
Разделы
Поиск
Поиск запросы
Статистика
Показы каталога организаций
Статистика клиенты
Пользователи
Сайты
Управление сайтом
Анкета
Аптеки
Афиша
Афиша новая
Баннеры
Бизнес >
Викторина
Голосование
Гость на сайте
Истории
Календарь событий
Каталоги >
Конкурс красоты
Конкурс аудио
Консультации
Меню
Новое на сайте
Новости >
Организации >
Программа ТВ
Публикации
Разделы сайта
Рассылка
Рестораны
Секрет фирмы >
Сервисы >
Ссылки
Тесты
Файловый менеджер
Форум
Фотогалерея
Обратная связь
Недвижимость
Новый год
Тексты
Пользователи
Юридический рейтинг
Отзывы на товары
Бан пользователей
Жалобы
Новые тесты
Коронавирус
Файловый менеджер
Имя файла
Timers.php
Содержимое
<?php namespace React\EventLoop\Timer; use SplObjectStorage; use SplPriorityQueue; class Timers { private $time; private $timers; private $scheduler; public function __construct() { $this->timers = new SplObjectStorage(); $this->scheduler = new SplPriorityQueue(); } public function updateTime() { return $this->time = microtime(true); } public function getTime() { return $this->time ?: $this->updateTime(); } public function add(TimerInterface $timer) { $interval = $timer->getInterval(); $scheduledAt = $interval + microtime(true); $this->timers->attach($timer, $scheduledAt); $this->scheduler->insert($timer, -$scheduledAt); } public function contains(TimerInterface $timer) { return $this->timers->contains($timer); } public function cancel(TimerInterface $timer) { $this->timers->detach($timer); } public function getFirst() { while ($this->scheduler->count()) { $timer = $this->scheduler->top(); if ($this->timers->contains($timer)) { return $this->timers[$timer]; } $this->scheduler->extract(); } return null; } public function isEmpty() { return count($this->timers) === 0; } public function tick() { $time = $this->updateTime(); $timers = $this->timers; $scheduler = $this->scheduler; while (!$scheduler->isEmpty()) { $timer = $scheduler->top(); if (!isset($timers[$timer])) { $scheduler->extract(); $timers->detach($timer); continue; } if ($timers[$timer] >= $time) { break; } $scheduler->extract(); call_user_func($timer->getCallback(), $timer); if ($timer->isPeriodic() && isset($timers[$timer])) { $timers[$timer] = $scheduledAt = $timer->getInterval() + $time; $scheduler->insert($timer, -$scheduledAt); } else { $timers->detach($timer); } } } }
/cron/instagram/vendor/react/event-loop/src/Timer/
Имя
Дата
Размер
..
2019-01-15
Timer.php
2019-01-15
2 кб.
TimerInterface.php
2019-01-15
1 кб.
Timers.php
2019-01-15
2 кб.
/cron/instagram/vendor/react/event-loop/src/Timer
Загрузить файлы
Файл 1
Файл 2
Файл 3