LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

How do i make a loop last a limited amount of time?

Root / Programming Questions / [.]

funcooldudes101Created:
I want to make a code last for a couple of seconds... How can i do that?

I want to make a code last for a couple of seconds... How can i do that?
I have this:
@compile
? Files
? Hardware
gosub @compile

Use MAINCNT to get the number of frames that have elapsed since your program was started. At 60 frames per second, two seconds will take 120 frames. So:
T=MAINCNT
WHILE MAINCNT < (T + 120)
 'do your stuff
WEND