Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-10-2006, 11:01 AM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default Counter in PHP

How do I make a counter in PHP for execution time?

This script took: <time>

??
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-10-2006, 01:14 PM
chaganlal1 chaganlal1 is offline
Learning Programmer
 
Join Date: Aug 2006
Posts: 79
Rep Power: 9
chaganlal1 is on a distinguished road
Default

If you are talking about page load time, this should help
http://www.pscode.com/vb/scripts/Sho...d=665&lngWId=8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-10-2006, 05:17 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Rep Power: 13
NeedHelp is on a distinguished road
Default

Here is a function I modified to do it:

PHP Code:
// Determine start time
function slog_time() {
    
$mtime microtime();
    
$mtime explode(" ",$mtime);
    
$mtime $mtime[1] + $mtime[0];
    
$starttime $mtime
    
    
// Return our time
    
return $starttime;
}

// Determine end time
function elog_time($starttime) {
    
$mtime microtime();
   
$mtime explode(" ",$mtime);
   
$mtime $mtime[1] + $mtime[0];
   
$endtime $mtime;
   
$totaltime = ($endtime $starttime);
   
   
// Return our display
   
return $totaltime
And then in your php do

PHP Code:
// Get time in HEADER
$startTime slog_time();

// Your php code here
.....................


// Get total time in FOOTER
$totalTime elog_time($startTime);

// Display it
print "Execution Time: $totalTime Seconds<br />"
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-10-2006, 08:28 PM
falco85 falco85 is offline
Programmer
 
Join Date: Apr 2006
Posts: 105
Rep Power: 10
falco85 is on a distinguished road
Default

Nice work n needhelp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 4 end of life announcement Jordan Programming News 4 08-30-2007 10:55 AM
PHP Introduction clookid PHP Tutorials 10 01-16-2007 08:17 AM


All times are GMT -5. The time now is 07:21 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads