General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 19th, 2002, 10:19 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 50 sec
Reputation Power: 16
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
"Page generated in..."

I see on some php pages they have something like "Page generated in 0.00126 secs with x SQL queries", how can I also put something like that on my site?
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #2  
Old July 19th, 2002, 10:33 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to Lindset Send a message via AIM to Lindset
PHP Code:
function getmicrotime() { 
    
$temparray split(" ",microtime()); 
    
$returntime $temparray[0] + $temparray[1]; 
    return 
$returntime
}
    
$starttime getmicrotime();

...
php...

$endtime getmicrotime();
echo 
"Page executed in " $starttime $endtime " seconds."


(think I grabbed this off zend.com somewhere)

and for the number of sql queries, I think you have to count them yourself.. increase a number after each query.. for example like this:

PHP Code:
 $sqlnum 0;

...
php...

mysql_query("SELECT blablablabla");
$sqlnum++;

...
php...

mysql_query("SELECT blablelkdhsl");
$sqlnum++; 


Hope this helps you
__________________
Best Regards,
Håvard Lindset

Last edited by Lindset : July 19th, 2002 at 10:36 AM.

Reply With Quote
  #3  
Old July 19th, 2002, 11:09 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 50 sec
Reputation Power: 16
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
Where I want the microtime do I just do getmicrotime(); ?

Reply With Quote
  #4  
Old July 19th, 2002, 11:10 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 50 sec
Reputation Power: 16
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
wait nevermind, i didn't read the code thoroughly, thx

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > "Page generated in..."


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap