swoole provides a JavaScript-like setInterval/setTimeout asynchronous high-precision timer with millisecond-level granularity. It's also very simple to use.
# SWOOLE provides a regular device for usage (Recommended learning: Swoole Video Tutorial ) ## r
This is how I used it. Take a look at the code.
$server->tick(1000, function() use ($server, $fd) { $server->send($fd, "hello world"); });
##
The above is the detailed content of How to apply swoole's timer. For more information, please follow other related articles on the PHP Chinese website!