[Stopwatch] Fix precision for root section
This commit is contained in:
parent
b24a338f71
commit
b2c0dc3901
@ -38,8 +38,8 @@ class Stopwatch
|
||||
*/
|
||||
public function __construct($morePrecision = false)
|
||||
{
|
||||
$this->reset();
|
||||
$this->morePrecision = $morePrecision;
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,6 +100,18 @@ class StopwatchTest extends TestCase
|
||||
$stopwatch->stop('foo');
|
||||
}
|
||||
|
||||
public function testMorePrecision()
|
||||
{
|
||||
$stopwatch = new Stopwatch(true);
|
||||
|
||||
$stopwatch->start('foo');
|
||||
$event = $stopwatch->stop('foo');
|
||||
|
||||
$this->assertInternalType('float', $event->getStartTime());
|
||||
$this->assertInternalType('float', $event->getEndTime());
|
||||
$this->assertInternalType('float', $event->getDuration());
|
||||
}
|
||||
|
||||
public function testSection()
|
||||
{
|
||||
$stopwatch = new Stopwatch();
|
||||
|
Reference in New Issue
Block a user