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  
Old 07-20-2007, 11:22 PM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
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
  #2  
Old 07-21-2007, 12:40 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
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 Off
Pingbacks are Off
Refbacks are Off

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 09:50 PM
How can we increase the execution time of a php script? Sabari PHP Programming 3 09-26-2007 08:23 AM
How Can I determine the phone number from my MIDlet? mobilegeek Mobile Software Development 1 07-23-2007 09:43 PM
reducing the query execution time kathir Database Support 1 07-19-2007 09:55 PM
How would you determine the time zone under which a database was operating? Sabari Database Support 2 07-19-2007 04:11 AM


All times are GMT -7. The time now is 02:34 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0