setDescription('Hyperf Demo Command'); } public function handle() { //记录执行时间 $start = microtime(true); for ($i = 0; $i < 200000; $i++) { $chatdata['receiver_id'] = 1; $chatdata['user_id'] = $i; $chatdata['group_receiver_id'] = 0; $chatdata['is_read'] = 1; $chatdata['action'] = 'said'; $message = new MqProducer($chatdata); $producer = ContextApplicationContext::getContainer()->get(Producer::class); $re = $producer->produce($message); } $this->info(microtime(true) - $start); $this->line('Hello Hyperf!', 'info'); } }