IdentifiantMot de passe
Mot de passe oublié ?Je m'inscris ! (gratuit)
Description of Objects in VPython

Limiting the Animation Rate

rate( frequency )

Halts computations until 1.0/frequency seconds after the previous call to rate().

For example, rate(50) will halt computations long enough to make sure that at least 1.0/50.0 second has elapsed (if this much time has already elapsed, no halt is performed). If you place rate(50) inside a computational loop, the loop will execute at a maximum of 50 times per second, even if the computer can run faster than this. This makes animations look about the same on computers of different speeds, as long as the computers are capable of carrying out 50 computations per second.