Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda