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

convertInto() 공개 정적인 메소드

Convert a given time INTO the given unit. That is, how many times the given time will fit into the the destination unit. i.e. x per unit.
public static convertInto ( $time, $unit, $destUnit ) : integer
리턴 integer
    public static function convertInto($time, $unit, $destUnit)
    {
        if (!$time) {
            return 0;
        }
        self::validateUnit($unit);
        self::validateUnit($destUnit);
        $destM = self::$map[$destUnit];
        $sourceM = self::$map[$unit];
        $time = $destM / ($time * $sourceM);
        return $time;
    }