1second1000millisecond1000, 000microsecond1000, 000,000 nanosecondphp has no default function in milliseconds, but a microtime () function is provided. the function returns two elements, one of which is the number of seconds, one is the number of milliseconds represented by decimals. with this function, you can easily define a function that returns the number of milliseconds, for example :*... 1 second = 1000 millisecond = 1000,000 microsecond = 1000,000,000 nanosecond
Php does not have a default function in milliseconds, but a microtime () function is provided. the function returns two elements, one being the number of seconds and the other being the number of milliseconds represented by decimals, with this function, you can easily define a function that returns the number of milliseconds, for example:
/** Get time difference, millisecond */function get_subtraction () {$ t1 = microtime (true); $ t2 = microtime (true); return ($ t2-$1) * 1000 ). 'Ms ';}
/** Microsecond millisecond * returns the number of milliseconds in the timestamp */function get_millisecond () {list ($ usec, $ sec) = explode ("", microtime (); $ msec = round ($ usec * 1000); return $ msec;}/*** returns the string's timestamp in milliseconds */function get_total_millisecond () {$ time = explode ("", microtime (); $ time = $ time [1]. ($ time [0] * 1000); $ time2 = explode (". ", $ time); $ time = $ time2 [0]; return $ time;}/*** returns the current Unix timestamp and the number of microseconds (expressed in seconds) floating point number representation, which is often used to calculate the code snippet execution time */function microtime_float () {list ($ usec, $ sec) = explode ("", microtime (); return (float) $ usec + (float) $ sec );}