swoole定时任务

timer.php

<?php
swoole_timer_tick(3000, function($timer_id){
        echo "执行$timer_id \n";
});

swoole_timer_after(5000,function(){
        echo "5s后执行\n";
});

运行定时任务

php timer.php
posted @ 2021-08-13 00:02  胡勇健  阅读(157)  评论(0编辑  收藏  举报