Naively the answer is that you need a while
loop:
while GetTickCount() < StartTime+600000 then
;
SecondRun();
Or perhaps more easily read, a repeat
loop:
repeat
until GetTickCount() >= StartTime+600000;
SecondRun();
But that's the wrong way to do it. You'll run the processor hot for 10 minutes, and achieve nothing. And I'm glossing over the fact that if your system has been up for 49 days then you'll hit GetTickCount
wrap-around and the logic of the test is then flawed.
The operating system has a function designed to solve your problem, it is called Sleep
.
Sleep(600000);
This blocks the calling thread for the specified number of milliseconds. Because the thread is blocks, the thread will not consume CPU resource while it is waiting.
This will make the calling thread unresponsive, so it's typically something that you would do in a background thread rather than an application's main thread.