PHP/Date/microtime

Материал из Web эксперт
Версия от 10:03, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

mixed microtime ( [bool float_output] ) returns a highly accurate reading of the current time

   <source lang="html4strict">

<? echo microtime( ); ?>

 </source>
   
  


Timing with microtime()

   <source lang="html4strict">

<?php $start = microtime(true); for ($i = 0; $i < 1000; $i++) {

   preg_match("/age=\d+/",$_SERVER["QUERY_STRING"]);

} $end = microtime(true); $elapsed = $end - $start;

 </source>