If you're only accounting for the time the controller takes, you can use the Stopwatch component:
http://symfony.com/doc/current/components/stopwatch.html
use Symfony\Component\Stopwatch\Stopwatch;
public function indexAction()
{
$stopwatch = new Stopwatch();
// Start event named 'eventName'
$stopwatch->start('eventName');
// ... some code goes here
$event = $stopwatch->stop('eventName');
// get total duration (but see the docs for more info)
$timeTaken = $event->getDuration(); // Returns the event duration, including all periods
...
}