예제 #1
0
 /**
  * @param $duration
  * @param $ops
  * @param $expected
  *
  * @dataProvider toStringProvider
  */
 public function testToString($duration, $ops, $expected)
 {
     $result = new Result($duration, $ops, new Method(null, ''), new Parameter(null, ''));
     $ur = new UnitResult();
     $ur->add($result);
     $this->assertEquals($expected, $result->getNormalizedOperationsPerUnit($ur));
 }
예제 #2
0
파일: Unit.php 프로젝트: nochso/benchmark
 /**
  * @param Method $method
  */
 private function fetchMethodResults(Method $method)
 {
     $params = $this->params;
     if (count($params) === 0) {
         $params[] = null;
     }
     foreach ($params as $paramKey => $parameter) {
         $this->notifyText($method->getName() . ' / ' . $parameter->getName());
         $result = $method->time($parameter);
         $this->result->add($result);
         $this->notifyProgress();
     }
 }