Home  >  Article  >  Backend Development  >  判断出数据库回来耗了多长时间?写盘耗了多长时间

判断出数据库回来耗了多长时间?写盘耗了多长时间

WBOY
WBOYOriginal
2016-06-13 12:59:551014browse

判断出数据库返回耗了多长时间?写盘耗了多长时间?
要在数据库查询完数据后将数据写入文件,但是等待时间太慢,想找出哪里花费时间比较长,数据大约有80万,有什么方法能跟踪到查询耗时和写盘的耗时
------解决方案--------------------
分步骤时间时间应该就可以了吧,可以用microtime精确到微妙
------解决方案--------------------
这些数据,一般数据库都会有内部变量,不是前端php所关心的,一般也不由前端来计算。

比如mysql用show global status; 就能获取很多内部信息,包括内存、磁盘占用等等。

具体可以针对你使用的数据库来google下看看

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn