News:

*NEW* Current Version on STEAM16.793

Webchat:
Visit the chat



fps?

Previous topic - Next topic

Richard Rae

When I use the following code on my PC  I only get an FPS of 30 even though it has been set to 60.The same happens on my laptop.

                    // FPS counter

LIMITFPS 60

WHILE TRUE


 dtime = GETTIMER()
 
 fps = ((1000/dtime))
 delay=delay+dtime
 IF delay>500 // 1/2 sec
  delay=0
  showfps=fps
 ENDIF
 
 PRINT "FPS: "+showfps+" dtime:"+dtime, 0,0
 PRINT actual,0,50
 SHOWSCREEN

WEND

Any ideas?

Schranz0r

Sync off, on youre Graphiccard !
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

Uh-Oh. A bug in GETTIMER.
Try this:
Code (glbasic) Select
LIMITFPS 60

WHILE TRUE
time = GETTIMERALL()
dtime = time - oldtime
oldtime = time

fps = ((1000/dtime))
delay=delay+dtime
IF delay>1000 // 1/2 sec
 delay=0
 showfps=fps
ENDIF

PRINT "FPS: "+showfps+" dtime:"+dtime+" dtime2:"+dtime2, 0,0
PRINT actual,0,50
dtime2 = GETTIMER()
SHOWSCREEN
WEND
Fixed in the next update.