LaysenseAuth/vendor/workerman/crontab/example/test.php

17 lines
347 B
PHP
Raw Permalink Normal View History

2024-08-09 22:16:39 +08:00
<?php
use Workerman\Worker;
require __DIR__ . '/../vendor/autoload.php';
use Workerman\Crontab\Crontab;
$worker = new Worker();
$worker->onWorkerStart = function () {
// Execute the function in the first second of every minute.
new Crontab('1 * * * * *', function(){
echo date('Y-m-d H:i:s')."\n";
});
};
Worker::runAll();