Look up the time() function. It returns the number of seconds since Jan 1,1970 and increments every second...
Code:unsigned long RunTime; unsigned long EndTime; // run for 60 seconds then quit EndTime = time(null) + 60; While (EndTime > RunTime) { RunTime = Time(null); // do a mess of stuf }