<?php
Swoole\Coroutine::getElapsed(int $cid = 0)
Coroutine ID. By default, use the ID of current coroutine.
The elasped time of a coroutine
Get the elapsed execution duration of a coroutine by coroutine ID.
<?php
Co\run(function () {
co::sleep(1.2);
echo Swoole\Coroutine::getElapsed();
});