swoole_process::signal(SIGALRM, function () {
static $i = 0;
echo "#{$i}\t alarm\n";
$i++;
if ($i > 20) {
swoole_process::alarm(-1);// 清除定时器
}
});

//100ms
swoole_process::alarm(100 * 1000);// 定时器,类似于定时触发,类似js 里面的setinterval()