public function testSimpleProfile() { $timeStart = microtime(true); $id = $this->profiler->simpleProfiler("some name"); usleep(5000); $timeEnd = microtime(true); $profiler = $this->profiler->stopProfiler($id); // Assert that the numbers are in the right order self::assertLessThan($timeEnd, $timeStart); self::assertLessThan($profiler['endTime'], $profiler['startTime']); // Our measured start and end times are roughly equal self::assertEquals($timeEnd, $profiler['endTime'], null, 0.1); self::assertEquals($timeStart, $profiler['startTime'], null, 0.1); }