Exemplo n.º 1
0
 public function testElapsedStartStop()
 {
     $this->stopWatch->start();
     usleep(2500);
     $this->stopWatch->stop();
     $elapsed = $this->stopWatch->getElapsedMilliseconds();
     $this->assertGreaterThanOrEqual(2, $elapsed);
     $this->assertLessThan(10, $elapsed);
     $elapsedSeconds = $this->stopWatch->getElapsedSeconds();
     $this->assertGreaterThanOrEqual(0.002, $elapsedSeconds);
     $this->assertLessThan(0.01, $elapsedSeconds);
     $elapsedMicroseconds = $this->stopWatch->getElapsedMicroseconds();
     $this->assertGreaterThanOrEqual(2000, $elapsedMicroseconds);
     $this->assertLessThan(10000, $elapsedMicroseconds);
 }