You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
422 B
PHP

<?php
use Workerman\Worker;
use \Workerman\Lib\Timer;
use \Workerman\Lib\Tool;
$bot_loop = new Worker();
$bot_loop->count = 1;
$bot_loop->name = "2秒后自动触发";
function BotFunc()
{
$res = Tool::post('http://code.dev.sa0.online:88/api/yo', []);
var_dump($res);
}
$bot_loop->onWorkerStart = function () {
BotFunc();
Timer::add(2, function () {
BotFunc();
});
};