public function testEnsureStopped() {
// this also test overlap between two periods
$event = new StopwatchEvent(microtime(true) * 1000);
$event
->start();
usleep(10000);
$event
->start();
usleep(10000);
$event
->ensureStopped();
$total = $event
->getTotalTime();
$this
->assertTrue($total >= 21 && $total <= 39, $total . ' should be 30 (between 21 and 39)');
}