Skip to content

Instantly share code, notes, and snippets.

@Barneybook
Created September 3, 2013 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Barneybook/6422244 to your computer and use it in GitHub Desktop.
Save Barneybook/6422244 to your computer and use it in GitHub Desktop.
取出時間的微秒 10^(-6) $usec是微秒的數值,要先放大一百萬倍,並補上零,當作小數點後的字串
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return (str_pad((float)$usec *1000000 /*+ (float)$sec*/,6,'0',STR_PAD_LEFT));
// str_pad($value,3,'0',STR_PAD_LEFT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment