pb-event-fast

Share your advanced PureBasic knowledge/code with the community.
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: pb-event-fast

Post by gurj »

@Little John:
thanks!
haha, :(

when debugger is off,
and change:
Debug b
Debug ElapsedMilliseconds()-q
to:
q=ElapsedMilliseconds()-q
MessageRequester("",""+b+~"\n"+q)

use virtual tables out:
b;my pc =-5
ElapsedMilliseconds()-q;my pc =342

use Select out:
b;my pc =-155
ElapsedMilliseconds()-q;my pc =174

@GedB:
thanks! :mrgreen:
You are like a teacher to guide students to progress, thank you again for your link !
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: pb-event-fast

Post by gurj »

I have just experimented a few times and found that:
Sometimes the virtual table is fast, sometimes the Select is fast, and the data changes relatively large, unstable.

Updated.

Change
eg=Random(20,1)
mi=Random(10,1)
to:
eg+1;=Random(20,1)
If eg>20
eg=1:EndIf

mi+1;=Random(10,1)
If mi>10
mi=1:EndIf

It's stable now, it's virtual table fast.:
virtual tables out:
b=2 time=144

Select out:
b=2 time=174
my pb for chinese:
http://ataorj.ys168.com
Post Reply