Page 1 of 1

making the DS pause for a set amount of time

Posted: Mon Sep 12, 2011 12:10 pm
by jettehhawk
So i'm trying to write a program on the DS (in c++ command line only) and i have come across a bit of a problem. I need the program to stop for a set amount of time so that it is not all processing fast, however I do not want it to stop or make the user have to press a button to continue. See I need to do what the Sleep() function in the windows.h header does but as this does not work for the compiler I need an alternative.
Please help.

Re: making the DS pause for a set amount of time

Posted: Mon Sep 12, 2011 8:42 pm
by WinterMute
The easiest way to do this is just call swiWaitForVBlank multiple times, i.e. for a 1 second pause use something like

Code: Select all

int count = 60;
while(count--) swiWaitForVBlank;
for longer/shorter delays then just muliply the number of seconds you want by 60.