Created
September 3, 2013 10:34
-
-
Save Barneybook/6422244 to your computer and use it in GitHub Desktop.
取出時間的微秒 10^(-6) $usec是微秒的數值,要先放大一百萬倍,並補上零,當作小數點後的字串
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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