Now that we have obtained two different timestamps from the system, is there any way to convert this difference into seconds plus milliseconds? ?
PHP中文网2017-05-16 13:11:51
function getMillisecond() {
list($t1, $t2) = explode(' ', microtime());
return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000);
}
echo getMillisecond();
Find a function online and give it a try
怪我咯2017-05-16 13:11:51
PHP’s timestamp can only go to the second level. If you add milliseconds, add 000 at the end