PhpBench\Util\TimeUnit::toDestUnit PHP 메소드

toDestUnit() 공개 메소드

Convert instance value to given unit.
public toDestUnit ( $time, $destUnit = null, $mode = null ) : integer
리턴 integer
    public function toDestUnit($time, $destUnit = null, $mode = null)
    {
        return self::convert($time, $this->sourceUnit, $this->getDestUnit($destUnit), $this->getMode($mode));
    }

Usage Example

예제 #1
0
 /**
  * It should convert one time unit to another in throughput mode.
  *
  * @dataProvider provideConvertThroughput
  */
 public function testConvertThroughput($time, $unit, $destUnit, $expectedThroughput)
 {
     $unit = new TimeUnit($unit, $destUnit);
     $result = $unit->toDestUnit($time, null, TimeUnit::MODE_THROUGHPUT);
     $this->assertEquals($expectedThroughput, $result);
 }