search

Home  >  Q&A  >  body text

javascript - How to calculate the time above the fold of a page?

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.

PHP中文网PHP中文网2778 days ago532

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-18 10:57:23

    Use the timeline and profile functions of chrome devtools.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-18 10:57:23

    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.

    reply
    0
  • Cancelreply