javascript - How to calculate the time above the fold of a page?
PHP中文网2017-05-18 10:55:23
0
2
525
Like the title How to calculate the first screen time of the page? The first screen may contain pictures and other resources, which may be rendered asynchronously.
Do you want to take a look or is it a business requirement? If you just want to take a look, you can use the devtool timeline. If needed for development, you can get the time in the first line of the server script, and then after the client js completes loading of the page, you can calculate the total time from getting the entire request to response and rendering based on the elapsed time.
Use the timeline and profile functions of chrome devtools.
Do you want to take a look or is it a business requirement? If you just want to take a look, you can use the devtool timeline.
If needed for development, you can get the time in the first line of the server script, and then after the client js completes loading of the page, you can calculate the total time from getting the entire request to response and rendering based on the elapsed time.