Intentionally Slow Down HTML/PHP Page Load to Test

前端 未结 8 1413
别跟我提以往
别跟我提以往 2020-12-08 04:32

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

8条回答
  •  星月不相逢
    2020-12-08 04:53

    You can use php's sleep($seconds) function to slow down a page load. However, you would need to turn implicit output buffer flushing to "on" with ob_implicit_flush(true); if you want anything to be sent to the user's browser before the page is done being processed. Otherwise your page won't have ANY contents until it's done loading. Calling sleep alone won't do the trick.

提交回复
热议问题