/** * Test some benchmarks. */ public function testTimer() { $this->object->timingStart(); try { // Linux $black_hole = fopen('/dev/null', 'w'); } catch (Exception $e) { // Windows $black_hole = fopen('null', 'w'); } for ($i = 0; $i < 500; $i++) { fputs($black_hole, $i); } $current = $this->object->timingCurrent(); $this->assertInternalType('float', $current); $this->assertTrue($current > 0); $this->object->timingStart('test'); for ($i = 0; $i < 500; $i++) { fputs($black_hole, $i); } $this->object->timingStop('test'); $current = $this->object->timingCurrent('test'); $this->assertInternalType('float', $current); $this->assertTrue($current > 0); fclose($black_hole); }