Swoole Server getReceivedTime()

Notice: ext-swoole is supported until v4.7.1, use ext-openswoole >= v4.7.1. Latest version: pecl install openswoole-4.9.1

Declaration

<?php
Swoole\Server->getReceivedTime()

Parameters

none

Return

last_received_usec

The last time the server received data.

Description

Get the last timestamp that the server received data.

Example

<?php
$server->on('receive', function ($server, $fd, $reactorId, $data)
{
    usleep(rand(100000, 2000000));
    var_dump(round($server->getReceivedTime(), 10));
});