Intentionally Slow Down HTML/PHP Page Load to Test

2019-01-16 18:36发布

I'm curious if there exists a method to intentionally slow the page load?

I'm testing my HTML & PHP pages on my local host right now, and I want to see how my loading gif etc will perform when the page load is slower.

I realize this is a rare request as most developers are only concerned with speeding up page loads, but I thought there might be a method, using either javascript/jQuery or PHP, to do something like this for testing purposes.

Thanks for any help!

Note: I'm testing on MAMP, so that's Apache server running on Mac OS 10.7

8条回答
我命由我不由天
2楼-- · 2019-01-16 19:01

In Chrome, you can simulate a slow Internet connection with the developer tools. under the "Network" Tab on the far right. You can use a preset like "Fast G3" or can create your own with exact numbers for upload, download and ping.

enter image description here

Reference: https://helpdeskgeek.com/networking/simulate-slow-internet-connection-testing/

查看更多
贪生不怕死
3楼-- · 2019-01-16 19:09

Call sleep() in your PHP code to delay the request to the server.

查看更多
登录 后发表回答