Mikus Posted July 6, 2006 Report Share Posted July 6, 2006 Kadz nezin kur vai kaa var izveidot lapas apaksa kad radas cik sekundees ieladejaas lapa? nu piemeram taka PHP-Fusion apaksa http://ripclan.sytes.net/news.php ceru uz jusu atsaucibu... Link to comment Share on other sites More sharing options...
Vebers Posted July 6, 2006 Report Share Posted July 6, 2006 // Ieliec dokumenta aukšpusē $startTime = round(microtime(), 3); // Ieliec dokument beigās $EndOfGeneration = round(microtime(), 3); $generation = $startTime - $EndOfGeneration; echo 'Lapa tika ģenerēta '.$generation.' sekundes'; Link to comment Share on other sites More sharing options...
v3rb0 Posted July 6, 2006 Report Share Posted July 6, 2006 ūja. no sākuma laika atņemot beigu laiku dabūsi tak negatīvas sekundes. vispār jau manuālī http://lv.php.net/microtime pirmais piemērs.. Link to comment Share on other sites More sharing options...
Mikus Posted July 6, 2006 Author Report Share Posted July 6, 2006 (edited) paldies tas piemers man palidzeja bet es veel tikai gribeju pajautat vai neav iespejams nedaudz saisinat so skaitli nu piemeram uz kadiem 6 cipariem nevis 16? aa nee nevajag palidzet :D paldies! <?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); usleep(100); $time_end = microtime_float(); $time = $time_end - $time_start; $laiks = substr($time,0,6); echo "Lapa ieladejas $laiks sekundes\n"; ?> Edited July 6, 2006 by Mikus Link to comment Share on other sites More sharing options...
Vebers Posted July 6, 2006 Report Share Posted July 6, 2006 substr(); Link to comment Share on other sites More sharing options...
v3rb0 Posted July 6, 2006 Report Share Posted July 6, 2006 it kā jau skaitļi vairāk draudzējas ar round(), ceil() un floor() nekā substr(). Link to comment Share on other sites More sharing options...
Mikus Posted July 6, 2006 Author Report Share Posted July 6, 2006 nu jaa bet kada tam tur starpiba, galvenais ta4u ir rezultats :D Link to comment Share on other sites More sharing options...
v3rb0 Posted July 6, 2006 Report Share Posted July 6, 2006 tāda ka nevajag taisīt liekus typecastus no float uz string. tas ka php nav ar roku jāpieraksta kur typecastot, nenozīmē ka typecasts nenotiek. Link to comment Share on other sites More sharing options...
Recommended Posts