首页
导航
博客
电子书
算法
众创
代码
随贴
关于我们
您好,欢迎来到码863代码分享网! 请
[登录]
/
[注册]
搜 索
标题:
*
140
字
TAG标签:
(用空格隔开)
30
字
恢复历史版本:
请选择分类
html
python
javascript
php
sql
c
c++
c#
java
plain
所有人可见
仅自己可见
编辑器:UEditor
编辑器:TinyMCE
编辑器:Editor.md
HTML转MD
HTML转MD2
<p>先说结论复杂点的<em>if判断语句千万次0.35秒,简单的千万次0.06秒 i5-8265u deepin20.2.4</em></p><p><br/></p><p><em>//<em style="white-space: normal;">千万次0.05秒 加empty is_null</em></em></p><p><br/></p><p>$start=microtime(true);</p><p>$i=0;</p><p>while($i++<10000000)</p><p>if(empty($i)){</p><p>}</p><p>echo "\n".number_format(microtime(true)-$start,9);</p><p><em><br/></em><em style="white-space: normal;">//<em>千万次0.07秒 加empty is_null</em></em></p><p><br/></p><p style="white-space: normal;">$start=microtime(true);</p><p style="white-space: normal;">$i=0;</p><p style="white-space: normal;">while($i++<10000000)</p><p style="white-space: normal;">if($i){</p><p style="white-space: normal;">}</p><p style="white-space: normal;">echo "\n".number_format(microtime(true)-$start,9);</p><p><em><br/></em><br/></p><p><em style="white-space: normal;">//<em>千万次0.2秒 </em></em></p><p>$start=microtime(true);</p><p>$i=0;</p><p>while($i++<10000000)</p><p>if(strpos('asdfsad.dfsdfdfsd','.')){</p><p>}</p><p>echo "\n".number_format(microtime(true)-$start,9);</p><p><br/></p><p><em style="white-space: normal;">//<em>千万次0.05秒 </em></em></p><p>function get(){</p><p><span style="white-space:pre"></span>return 'ok';</p><p>}</p><p>$start=microtime(true);</p><p>$i=0;</p><p>while($i++<10000000)</p><p>get();</p><p>echo "\n".number_format(microtime(true)-$start,9);</p><p><br/></p><p><em style="white-space: normal;">//<em>万次0.14秒 ssd硬盘</em></em></p><p>$start=microtime(true);</p><p>$i=0;</p><p>while($i++<10000)</p><p>@file_get_contents('./'.$i.'.txt');</p><p>echo "\n".number_format(microtime(true)-$start,9);</p><p><br/></p>
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网
湘ICP备2023018646号-1
MYSQl共执行 4 个查询,用时 0.0024149417877197 秒,PHP脚本用时 0.006172 秒,占用内存 0.501 MB,Gzip 已启用