<?php
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Stopwatch\StopwatchPeriod;
$sw = new Stopwatch();
$sw->start('id');
$test = range(0, 100000);
foreach ($test as $val) {
$val + 1000;
}
$swEvent = $sw->stop('id');
echo $swEvent->getStartTime() . PHP_EOL;
echo $swEvent->getEndTime() . PHP_EOL;
echo $swEvent->getDuration() . PHP_EOL;
echo $swEvent->getMemory() . PHP_EOL;