← Desenvolvimento

Ver quanto tempo leva um site a abrir

Lida 3931 vezes

Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Olá colegas, preciso de uma ferramenta para fazer o que diz no título, ou seja, ver estatísticas de quanto tempo leva o site a abrir.

Já vi um mas não gostei da precisão, alguém aconselha um bom?
Offline

BlueEagle 
Membro
Mensagens 2221 Gostos 1
Troféus totais: 31
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

Para colocares no site ou para veres no browser?

No caso de ser no browser, tens o Extended Status Bar para o firefox.
Offline

Joao Santos 
Membro
Mensagens 149 Gostos 9
Troféus totais: 30
Trófeus: (Ver todos)
Search Linux User Mobile User Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5

Offline

CasaTuga 
Membro
Mensagens 397 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Avatar Tenth year Anniversary Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Variàveis:
Código: [Seleccione]
<?php
$starttime 
microtime();
$startarray explode(" "$starttime);
$starttime $startarray[1] + $startarray[0];
?>

Código: [Seleccione]
<?php
$endtime 
microtime();
$endarray explode(" "$endtime);
$endtime $endarray[1] + $endarray[0];
$totaltime $endtime $starttime;
$totaltime round($totaltime,5);
echo 
"This page loaded in $totaltime seconds.";
?>
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

A que uso é o firebug  https://addons.mozilla.org/pt-BR/firefox/addon/1843

Tenho isso instalado, onde vês o tempo?

Variàveis:
Código: [Seleccione]
<?php
$starttime 
microtime();
$startarray explode(" "$starttime);
$starttime $startarray[1] + $startarray[0];
?>

Código: [Seleccione]
<?php
$endtime 
microtime();
$endarray explode(" "$endtime);
$endtime $endarray[1] + $endarray[0];
$totaltime $endtime $starttime;
$totaltime round($totaltime,5);
echo 
"This page loaded in $totaltime seconds.";
?>

Obrigado, vou aplicar também no site.

Para colocares no site ou para veres no browser?

No caso de ser no browser, tens o Extended Status Bar para o firefox.

Ok, obrigado. Vou ver isso...
Offline

HeM 
Membro
Mensagens 95 Gostos 0
Troféus totais: 24
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Poll Starter Level 4 Level 3 Level 2 Level 1 50 Posts

Pesquisa por YSlow...
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Pesquisa por YSlow...

Já instalei. Muito fixe!
Obrigadíssimo
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Ou então podes usar o seguinte:

Código: [Seleccione]
<?php $__start microtime(true); ?>

<p>O conteúdo da página fica aqui!</p>

<p>Depois é só veres o source code para veres quantos segundos demorou a página a ser gerada.</p>

<?php echo '<!-- Página gerada ' , ( microtimetrue ) - $__start ) , ' em segundos. -->'?>

Mas se já estás servido, melhor  :cool:
Offline

andre_mz 
Membro
Mensagens 688 Gostos 0
Feedback +3

Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

Eu uso o FasterFox, que diz quanto tempo demora cada página a fazer o load completo, mas secalhar não é muito preciso, apesar de ir até aos 0,001 segundos.;)