, Arpad Ray * @link http://php.net/function.microtime * @author Aidan Lister * @author Arpad Ray * @version $Revision: 1.3 $ * @since PHP 5.0.0 (Added optional get_as_float parameter) * @require PHP 4.0.0 (user_error) */ function php_compat_microtime($get_as_float = false) { if (!function_exists('gettimeofday')) { $time = time(); return $get_as_float ? ($time * 1000000.0) : '0.00000000 ' . $time; } $gtod = gettimeofday(); $usec = $gtod['usec'] / 1000000.0; return $get_as_float ? (float) ($gtod['sec'] + $usec) : (sprintf('%.8f ', $usec) . $gtod['sec']); } // Define if (!function_exists('microtime')) { function microtime($get_as_float = false) { return php_compat_microtime($get_as_float); } }