Slammer Posted January 6, 2007 Report Share Posted January 6, 2007 Kā lai to parāda.. es domāju kaut ko līdzīgu tādam tekstam --> Query took 0.0139 sec .. nu vismaz tās sekundes.. ar print_r rādās kaut kāds resource id wtf? Link to comment Share on other sites More sharing options...
Blitz Posted January 6, 2007 Report Share Posted January 6, 2007 (edited) nuu sita var... $start=microtime(true); //mysql query $end=microtime(true); echo $end-$start; un tas tacu ir resource handle nevis masivs, takaa print_r tur niprichom. Edited January 6, 2007 by Blitz Link to comment Share on other sites More sharing options...
Slammer Posted January 6, 2007 Author Report Share Posted January 6, 2007 (edited) Kaut kas nav tā.. -1168086142 Edited January 6, 2007 by Slammer Link to comment Share on other sites More sharing options...
andrisp Posted January 6, 2007 Report Share Posted January 6, 2007 Slammer, pamēģini no php.net/microtime 1. piemēru. Tas, ko Blitz iedeva, iespējams strādā tikai uz PHP5 (vismaz manuālis tā saka). Link to comment Share on other sites More sharing options...
Slammer Posted January 6, 2007 Author Report Share Posted January 6, 2007 Man jau arī stāv 5.2.0 Ieliku starp savu sql pieprasījumu Link to comment Share on other sites More sharing options...
andrisp Posted January 6, 2007 Report Share Posted January 6, 2007 Iemet iekš paste.php.lv to daļu. Link to comment Share on other sites More sharing options...
Slammer Posted January 6, 2007 Author Report Share Posted January 6, 2007 Разобрался :D palīdzēja šitais: function stuff() { $t1 = microtime(true); $t2 = microtime(true); echo sprintf('%.6f', ($t2 - $t1) ) . "\r\n"; } Link to comment Share on other sites More sharing options...
bubu Posted January 6, 2007 Report Share Posted January 6, 2007 Ar ko tas atšķirās no Bllitz teiktā? Link to comment Share on other sites More sharing options...
Kristabs Posted January 6, 2007 Report Share Posted January 6, 2007 A kā to funkciju izmanto? :) Link to comment Share on other sites More sharing options...
black Posted January 9, 2007 Report Share Posted January 9, 2007 Šo funkciju lieto tad, ja šefam jāparāda, cik laba datubāze uztaisīta. Pēc kverija izsaucam funkciju, un - ak tavu brīnumu! - tiek parādīts, ka kverijs izpildījies zibenīgi!!! Link to comment Share on other sites More sharing options...
Delfins Posted January 9, 2007 Report Share Posted January 9, 2007 Gaida stundu un dabū 0 sec / 99% uptime :) Link to comment Share on other sites More sharing options...
v3rb0 Posted January 9, 2007 Report Share Posted January 9, 2007 a ērtak mērīt ar f-ju, kuru vienreiz saucot iesledz taimeri, otreiz izsaucot dabū pirms cik ilga laika iesledza taimeri. aptuveni šita. function timer() { static $time; static $start = false; list($usec, $sec) = explode(" ", microtime()); $microtime = ((float)$usec + (float)$sec); $start = !$start; return $start ? $time=((float)$usec+(float)$sec) : (float)round($microtime-$time,3); } // example timer(); sleep(2); // thipa kverijs echo timer(); Link to comment Share on other sites More sharing options...
Recommended Posts