You are here: Re: OT: PHP elapsed time question... « HTML « IT news, forums, messages
Re: OT: PHP elapsed time question...

Posted by Jonathan N. Little on 03/24/06 15:19

Noozer wrote:
> I've got a PHP question (it's my first PHP script)... Hopefully there's a
> quick answer.
>
> Why does the following show a 17 hour difference when the "Some Stuff" code
> actually takes only 42 seconds?
>
> For output I get:
> Elapsed time was 17:00.42.
>
>
> <?php
>
> $start_time = mktime();
>
> //42 seconds of some stuff happening here
>
> $finish_time = mktime();
>
> echo "Elapsed time was ".(date("G:i.s",$finish_time-$start_time)).".";
>
> ?>

Resolution, you are using the wrong function

http://www.php.net/manual/en/function.microtime.php
microtime()

vs

http://www.php.net/manual/en/function.mktime.php
mktime()

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация