PHP Salt


A little dash of PHP... my collection of php functions

Version: 2.14.1
Last Build: March 10, 2017 13:28pm (PST)

psMicroTime()
Micro Time - Float


Description:

This returns a float value of time in seconds with a decimal

Note: This function was coppied directly from the php site

http://php.net/manual/en/function.microtime.php




Usage:


$varFloat = psMicroTime();





Example:



$time_start = psMicroTime();

// Sleep for a while
usleep(100);

$time_end = psMicroTime();
$time = $time_end - $time_start;

echo "Did nothing in $time seconds\n";

?>





Code:


function psMicroTime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}


Changlelog:


See Also

And a shot out to:

LinuxSimple - www.linuxsimple.com
PHP - php.net
Fedora Server - getfedora.com
Shameless ads to pay for site