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

getDestUnit() 공개 메소드

Return the destination unit.
public getDestUnit ( string $unit = null ) : string
$unit string
리턴 string
    public function getDestUnit($unit = null)
    {
        // if a unit is given, use that
        if ($unit) {
            return $unit;
        }
        // otherwise return the default
        return $this->destUnit;
    }

Usage Example

예제 #1
0
 /**
  * It should use the default values for mode and dest unit if null values are given.
  */
 public function testDefaultValuesModeAndDestUnit()
 {
     $unit = new TimeUnit(TimeUnit::SECONDS, TimeUnit::MINUTES, TimeUnit::MODE_THROUGHPUT);
     $this->assertEquals(TimeUnit::MINUTES, $unit->getDestUnit());
     $this->assertEquals(TimeUnit::MODE_THROUGHPUT, $unit->getMode());
 }