Simply say it. Microtime () If a true argument is taken, the return will be a floating-point type. So t1 and T2 get is two floating point number, subtract and get the difference between. Because the number of bits in the floating point is very long, or is not sure, then use a round () to remove the decimal point 3 bits. So our purpose is to reach the ~
| The code is as follows |
Copy Code |
$t 1 = microtime (true); // ... Execute code ... $t 2 = Microtime (true); Echo ' time-consuming '. Round ($t 2-$t 1,3). ' Seconds '; |
Simply say it. Microtime () If a true argument is taken, the return will be a floating-point type. So t1 and T2 get is two floating point number, subtract and get the difference between. Because the number of bits in the floating point is very long, or is not sure, then use a round () to remove the decimal point 3 bits. So our purpose is to reach the ~
Microtime usage
The Microtime () function returns the current Unix timestamp and the number of microseconds.
Grammar
Microtime (get_as_float) parameter description
Get_as_float if the Get_as_float parameter is given and its value is equivalent to TRUE, the function returns a floating-point number.
http://www.bkjia.com/PHPjc/445305.html www.bkjia.com true http://www.bkjia.com/PHPjc/445305.html techarticle just say it. Microtime () If you have a true argument, the return will be a floating-point type. So t1 and T2 get two floating-point numbers, subtract the difference between them. Because floating point ...