标签:star echo mic 技术分享 info sage 时间转换 ext 技术
<?php $stratTime = microtime(true); $startMemory = memory_get_usage(); $a = 1; for($i = 1; $i <= 100000; $i++){ $a++; } echo $a; $endTime = microtime(true); $runtime = ($endTime - $stratTime) * 1000; //将时间转换为毫秒 $endMemory = memory_get_usage(); $usedMemory = ($endMemory - $startMemory) / 1024; echo "运行时间: {$runtime} 毫秒<br />"; echo "耗费内存: {$usedMemory} K";
运行情况
100001运行时间: 3 - 7 毫秒
耗费内存: 0.109375 K
标签:star echo mic 技术分享 info sage 时间转换 ext 技术
原文地址:https://www.cnblogs.com/qhorse/p/9044943.html