Is it possible to have the performance inside a loop?
A very basic example:
\Performance\Performance::point('Test Root');
sleep(3);
for ($i = 1; $i <= 10; $i++) {
$sleepTime = rand(1,4);
\Performance\Performance::point('Sub ' . $i . ' (' . $sleepTime . ')');
sleep($sleepTime);
\Performance\Performance::finish();
}
\Performance\Performance::finish();
\Performance\Performance::results();
Test Root should contain all the sleep() seconds combined, because that is what it take to run the whole for loop. But it just gives 3s, so the next Point stops the previous one.
Shouldn't it be possible to take the real performance time?
Is it possible to have the performance inside a loop?
A very basic example:
Test Rootshould contain all thesleep()seconds combined, because that is what it take to run the wholeforloop. But it just gives 3s, so the next Point stops the previous one.Shouldn't it be possible to take the real performance time?