1. tick_rate() and fps.

C & K L,
Try timing a single statement using
atom time_a

time_a = time()
-- Statement
time_a = time() - time_a
printf(1, "%0.15f", time_a )

You'll probablely get 0. Why? Because your computer is so fast that by the
time it had done the statement the clock hadn't changed. Speed up the clock
using a higher tick_rate() (It's about 18 normally) and it may actually
change before the instruction is done. DOS usually won't change the clock
more than once every 0.05 seconds.
The simplest way to time frames per second. Is to do...

atom until
until = time() + 60
integer count
count = 0

while time() < until do
  -- Draw frame.
        count = count + 1
end while

printf(1, "%d fps", count-1 )

This will tell you how many you can _complete_ .
--------------------
Sincerely,
Mathew Hounsell

Mat.Hounsell at Excite.Com




_______________________________________________________
Get your free, private e-mail at http://mail.excite.com/

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu