phpmock\functions\MicrotimeConverter::convertStringToFloat PHP Method

convertStringToFloat() public method

Converts a string microtime into a float.
public convertStringToFloat ( string $microtime ) : float
$microtime string The microtime.
return float The microtime as float.
    public function convertStringToFloat($microtime)
    {
        /*
         * This is from the manual:
         * http://php.net/manual/en/function.microtime.php
         */
        // list($usec, $sec) = explode(" ", $microtime);
        // This seems to be more intuitive as an inverse function.
        list($usec, $sec) = sscanf($microtime, "%f %d");
        return (double) $usec + (double) $sec;
    }