We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Get response time?

Hi,

I would like to get the full response time of the micro serving a request.

Is there any other easier, cleanier way rather than using the following pseudo code?

Thanks.

$app->before(function() use ($app) { var start = mictorime() });

$app->finish(function() use ($app) { log(microtime() - start) });
<?php

$app->finish(function () {
    printf('%.2f ms', (microtime(TRUE) - $_SERVER['REQUEST_TIME_FLOAT']) * 1000);
});


1.1k

Thanks Oscar,

I was hoping to have something like

$profiler = new Phalcon\Db\Profiler();

Maybe we need something for http?



6.4k
Accepted
answer
edited Apr '15

Thanks Oscar,

I was hoping to have something like

$profiler = new Phalcon\Db\Profiler();

Maybe we need something for http?

There is https://prophiler.fabfuel.de/demo.php



1.1k

Awesome, that is what I was looking for!