carno-php/timer

1.0.0 2018-08-15 09:28 UTC

This package is auto-updated.

Last update: 2024-09-17 22:04:19 UTC


README

安装

composer require carno-php/timer

用法

$id = Timer::loop(10, function () {
    echo 'triggering every 10ms', PHP_EOL;
});
Timer::after(500, function () use ($id) {
    echo 'trigger once after 500ms', PHP_EOL;
    echo 'and clear previous created loop timer', PHP_EOL;
    Timer::clear($id);
});