PhpBench\Util\TimeUnit::convertInto PHP Method

convertInto() public static method

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
return 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;
    }