IT Community - Software Programming, Web Development and Technical Support

Determine execution time in PHP

This is a discussion on Determine execution time in PHP within the PHP Programming forums, part of the Web Development category; Determine execution time in PHP...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-21-2007, 12:22 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Default Determine execution time in PHP

Determine execution time in PHP
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-21-2007, 01:40 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: Determine execution time in PHP

It will determine the time taken for a php script to execute correct to 0.000000000000001 seconds.
<!-- put this at the top of the page -->
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
;?>

<!-- put other code and html in here -->


<!-- put this code at the bottom of the page -->
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "This page was created in ".$totaltime." seconds";
;?>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/php-programming/2389-determine-execution-time-php.html
Posted By For Type Date
Determine execution time in PHP | Web Hosting This thread Refback 12-21-2007 02:35 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can we increase the execution time of a php script? sundarraja PHP Programming 0 02-01-2008 10:50 PM
Determine Leap Year Function srikumar_l Database Support 0 12-21-2007 06:04 AM
How can we increase the execution time of a php script? Sabari PHP Programming 3 09-26-2007 09:23 AM
reducing the query execution time kathir Database Support 1 07-19-2007 10:55 PM
How would you determine the time zone under which a database was operating? Sabari Database Support 2 07-19-2007 05:11 AM


All times are GMT -7. The time now is 03:17 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0