Request - DELAY (millisecs)

Previous topic - Next topic

PeeJay

Nice simple command to pause program execution for a set length of time.

While I have already written a function to do this:

Code (glbasic) Select
FUNCTION Pause: ms

LOCAL time1,time2
time1=GETTIMERALL()

WHILE TRUE
time2=GETTIMERALL()
IF time2>time1+ms THEN BREAK
WEND

ENDFUNCTION
it would be nice to have it as part of the language.
www.peejays-remakes.co.uk
For games, remakes, and GL Basic Tutorials
Artificial Intelligence is no match for Natural Stupidity

S.O.P.M.

What do you think, is this the same than a delay command? Will it save CPU power?
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

Schranz0r

IF timer < GETTIMERALL()
    ....SOME CODE.....
    timer = GETTIMERALL()+delay
ENDIF
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

New command: SLEEP, get the update ;)

S.O.P.M.

Yeah. This will save CPU power.
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium