Article View: es.comp.lenguajes.php
Article #163�cuanto tarda mi script en ejecutarse?
From: sufridor
Date: Fri, 12 Dec 2008 11:24
Date: Fri, 12 Dec 2008 11:24
22 lines
1770 bytes
1770 bytes
Hola.
Quer�a saber cuanto tarda un script en ejecutarse, lo hago asi:
--------------------------------------------------
$t1=microtime();
for ($indice=0; $indice<300; $indice++) {
echo ' - '. $indice;
}
$t2=microtime();
$t3 = $t2 - $t1;
echo '<p>'. $t3;
--------------------------------------------------
este es mi script chorra, un bucle for para gastar tiempo, (simplemente saca
por pantalla los n�meros del 0 al 299), pero ocurre un problema, le doy
muchas veces a F5, y siempre me da valores distintos (en la variable $t3),
muy distintos... y lo que he puesto dentro del bucle deber�a tardar siempre
lo mismo �no?.
�esto es normal?, �estoy haciendo algo mal?
Technical Details
Message-ID:
<ghtgv5$vu4$1@caladan.landsraad.net>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!news.ripco.com!news-out.newsfeeds.com!prop.superfeed.net!news-in1.superfeed.net!caladan.landsraad.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 107579,188a9ac2e79a2f9f,start X-Google-Attributes: gid107579,domainid0,public,usenet X-Google-Language: SPANISH,ASCII Subject: �cuanto tarda mi script en ejecutarse? From: "sufridor" <dsfff@eee.ee> Date: Fri, 12 Dec 2008 12:24:11 +0100 Message-ID: <ghtgv5$vu4$1@caladan.landsraad.net> Lines: 24 NNTP-Posting-Host: 84-18-31-138.usul.arrakis.es Organization: Servidor News Arrrakis, Servicios y Comunicaciones, S.L.U. Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!news.ripco.com!news-out.newsfeeds.com!prop.superfeed.net!news-in1.superfeed.net!caladan.landsraad.net!not-for-mail Newsgroups: es.comp.lenguajes.php X-Trace: caladan.landsraad.net 1229080358 32708 84.18.31.138 (12 Dec 2008 11:12:38 GMT) X-Complaints-To: usenet@caladan.landsraad.net NNTP-Posting-Date: Fri, 12 Dec 2008 11:12:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198