This site requires JavaScript, please enable it in your browser!
Greenfoot back
Duta
Duta wrote ...

2011/10/4

How many times per second does Run execute the act() methods?

Duta Duta

2011/10/4

#
On, say, the middle setting on the speed bar next to the Run&Act&Reset? I can time it myself later once I get home, however for now it would be easier if someone else just knew it :p
kiarocks kiarocks

2011/10/4

#
i think, the bar is speed 1 to 100, then the if the far left executes at 1 every one second, then the middle is probably 50 times a second
nccb nccb

2011/10/4

#
Hi, I can give you the definite answer based on the Greenfoot source code. This is accurate for 2.1.2 and probably most recent versions, but is not guaranteed to stay the same in future. Below is a list of speed setting on the left (which is 1 to 100 as kiarocks said), and the aimed-for frames-per-second on the right. If your scenario cannot sustain the desired FPS (which is almost guaranteed at the highest speeds), it will just run as fast as possible. Here's the list:
1: 0.11
6: 0.22
11: 0.41
16: 0.78
21: 1.48
26: 2.82
31: 5.36
36: 10.19
41: 19.38
46: 36.83
51: 70.00
56: 133.06
61: 252.92
66: 480.75
71: 913.80
76: 1736.95
81: 3301.56
86: 6275.57
91: 11928.62
96: 22673.68
I've just given every fifth value, but hopefully you get the rough idea. It pretty much doubles the desired FPS every five frames.
Duta Duta

2011/10/4

#
Wow, so at the far right (100) it's doing (or attempting to) do 40 thousand frames per second? Jesus. :L Alright, was just wondering because I was thinking of making myself a better way of timing where you could actually input a seconds value and with some calculations it would... well never mind, I can't be asked dealing with that atm >.< Thanks though, that was interesting.
You need to login to post a reply.