BlameThePixel!

BTForum » Main BTP Stuff » BlameTheGeneralDiscussion » PHP problem

Page: [] [2]
[]Dingbats
;
Send PM
An Avatar
Posts: 1970
Threads: 50
Mood: Optative
Money: £268.57 (D)
(+ Friend)
Not online within the last half an hour
I'll try your way of doing it...

Edit: Yep it worked! Thanks.:)
I still can't see what's wrong with what I said in post #14, though. By the way, how do you make this to appear:
[38 Queries, Page Loaded in 0.770209 Seconds]? What variables?
11.03.04 19:20
Post #16
Last edited: 11.03.04 19:34 (Dingbats - 1 times) [Softbrain Games] [Hide Sig (2)] [Profile] [Quote]
[S]Zogger!
Looking For Status
Send PM
Posts: 3954
Threads: 62
Money: £93.82 (D)
(+ Friend)
Not online within the last half an hour
$i = 0 wouldn't work, because it would try dividing by 1, and obviously that's going to be divisible, it's part of the definition of a prime number. ;)


And to do the loading time, you call microtime() at the beginning of the page and at the end of the page, then subtract the first from the second, and turn it into seconds. It's more complicated than that, though, because microtime returns an array, methinks. Here's what the PHP manual says:

\n
<?PHP\n
function getmicrotime(){ 
   list(
$usec$sec) = explode(" ",microtime());
   
return ((float)$usec + (float)$sec); 
   } 

$time_start = getmicrotime(); 
    
for (
$i=0$i 1000$i++){ 
   
//do nothing, 1000 times
   


$time_end getmicrotime(); 
$time $time_end $time_start;

echo "Did nothing in $time seconds"
\
n?>
\n

And for the queries, we have a function for a mysql query, and whenever it's called it increments the variable $querycount by 1.

________________
You know I'm a dancing machine
13.03.04 11:14
Post #17
[Hide Sig (8)] [Profile] [Quote]
[]Dingbats
;
Send PM
An Avatar
Posts: 1970
Threads: 50
Mood: Optative
Money: £268.57 (D)
(+ Friend)
Not online within the last half an hour
OK. I thought it was easier than that to display the loading time. And now I see what was wrong with my code...:P
13.03.04 11:19
Post #18
[Softbrain Games] [Hide Sig (2)] [Profile] [Quote]
[S]ReadMe
Absent
Send PM
Posts: 2820
Threads: 85
Money: £43.42 (D)
(+ Friend)
Not online within the last half an hour
i think another important bit ur missing is the ceil() function when you divide the number by two to start finding factors. This rounds up so you wont get a nasty fraction.

________________
Cant be arsed to remake my sig.
14.03.04 17:19
Post #19
[Hide Sig (7)] [Profile] [Quote]
[]Dingbats
;
Send PM
An Avatar
Posts: 1970
Threads: 50
Mood: Optative
Money: £268.57 (D)
(+ Friend)
Not online within the last half an hour
OK. Well, I'm still kind of a newb, but I'll learn.:)
14.03.04 17:41
Post #20
[Softbrain Games] [Hide Sig (2)] [Profile] [Quote]
Page: [] [2]

Post Reply

Jump To:


Your Comments:

Donate to BlameThePixel:
Donate to BTP Via PayPal


[22 Queries, Page Loaded in 0.319950 Seconds]

ShoutMeUp

Xmas Greetings from waka waka waka waka []Unvalidated EmailChristmasRiddle MERRY CHRISTMAS EVERYONE! []Spleet Except for Spleet. []TheAbdBoy Always bummin' a brother out. []Spleet Happy New Year everyone! But Spleet. []TheAbdBoy

Word Association

All

-10 Ago-

MiddleEastern []AlphaWolf camel [S]Bloopy toe []TheAbdBoy moose knuckle [S]Bloopy MeatLoaf []Spleet IdDoAnything4Lo ve []AlphaWolf rub n tug []TheAbdBoy tugboat []The Pope rope [S]Bloopy race []TheAbdBoy

-Latest-


Must be logged in to add new words

FictoLeague

You have to be logged in to vote...

Member Stats

Date: 04.05.24.
Members: 4731.
Latest: []Unvalidated Emailsdsakldsaldklasdsdsa
Active:
0 user(s)
1 guest(s)

On chat:
Lots of people

Files: 3330

Bloopy's Site
Get Firefox Get Opera Donate to BTP Via PayPal