I have to write a program that will terminate after 30 seconds, I have not a clue on how to go about ending it in the specified time frame...
Any help would be greatly appreciated.
Thank You!
Printable View
I have to write a program that will terminate after 30 seconds, I have not a clue on how to go about ending it in the specified time frame...
Any help would be greatly appreciated.
Thank You!
I recommend using a loop within loop. Use simple counting loops
My OS is XP home, I'm using Microsoft's Visual C++ 6.0, & this will be a console app.
create a DWORD value and continuously get do timeGetTime()...add it to itself over and over, and then have this all in a while loop
of course, thats just something thrown randomly together, but it might workCode:while (DWORD value < 30000)
{
DWORD value = timeGetTime();
DWORD value += DWORD value;
}
Right on! Thanks everyone.