setName('SenAirdrop')->setDescription('Here is the remark '); } protected function execute(Input $input, Output $output) { // 记录开始运行的时间 $GLOBALS['_beginTime'] = microtime(TRUE); $output->writeln('定时任务开始执行:' . date('Y-m-d H:i:s', time())); // 发放团队奖励 $teamRewards = new AirdropLogic(); $teamRewards->setAirdropRewards(); $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时 $output->writeln('定时任务执行结束,总耗时' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒'); } }