一道关于microtime()的题目
php获取时间的函数
$gtc_end_time = microtime(true);
从下面这种数列中(1000个吧),
19493845809,24359390850934,3435345,4345345,5345345,6345345,73453453 ……
判断某个数:234343345 是否存在这里面,
计算一下看需要多少时间
------解决方案--------------------
$k = 10000; $ar = range(1, $k); $t = microtime(true); if(in_array($k, $ar)) echo microtime(true) - $t; <div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号