Swoole\Server->getReceivedTime()

Declaration

<?php
Swoole\\Server->getReceivedTime()

Parameters

Return

last_receive_usec

The last time receiving data

Description

Get the time used to receive the data sent to the server.

Example

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