File
- drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php, line 65
Class
- StopwatchEventTest
- StopwatchEventTest
Namespace
Symfony\Component\HttpKernel\Tests\Debug
Code
public function testTotalTime() {
$event = new StopwatchEvent(microtime(true) * 1000);
$event
->start();
usleep(20000);
$event
->stop();
$total = $event
->getTotalTime();
$this
->assertTrue($total >= 11 && $total <= 29, $total . ' should be 20 (between 11 and 29)');
$event = new StopwatchEvent(microtime(true) * 1000);
$event
->start();
usleep(10000);
$event
->stop();
$event
->start();
usleep(10000);
$event
->stop();
$total = $event
->getTotalTime();
$this
->assertTrue($total >= 11 && $total <= 29, $total . ' should be 20 (between 11 and 29)');
}