PHP/Date/microtime

Материал из Web эксперт
Перейти к: навигация, поиск

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>