查找codeigniter视图渲染所花费的时间
问题描述:
I am loading 3 views in CI controller. How may i compute the time taken by all the three views to render completely? Any help?
我在CI控制器中加载3个视图。 我如何计算三个视图完全渲染所用的时间? 有什么帮助吗? p> div>
答
Use the Codeigniter Native function
Place it in your footer OR end of the page
<strong>Page Execution Time {elapsed_time}</strong>
Read more here from Codeigniter Docs Benchmarking Class
答
As mentioned in my comment, you can use microtime
or similar to do so:
- First, get time before Render
- Then proceed to render
- Finally, get time after render and compute difference