Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Is there a way to time script download time separately from execution?

I'd like to instrument some timing variables for my main JavaScript load. I could do something like this:

<script>
  performance.mark('script-start')
</script>
<script src="something.js"></script>

Then somewhere in something.js add a performance.measure('script-start').

The problem is that this would time both the script download time and the script parsing and (part of) the execution time. Is there a way to time script download and execution separately?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Put performance.measure('script-start') at the very beginning of something.js. This will include the parse time, but not the execution time. Unless the script is enormous, the parse time should be almost negligible.

You could time the download and execution separately by putting performance.mark('download-start') in the first <script> tag. Then put

performance.measure('download-end');
performance.start('script-start');

at the beginning of something.js.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!