Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Iterate on second

Name: Anonymous 2007-08-25 6:47 ID:sc0LfXCq

I've been trying to make a loop that will only repeat when a second has passed.  Basically it will check every second to see if the current time is equal to a specified time.  At the moment my program just repeats the same number about a thousand times before  it reaches the next one...any halp guyz?

Name: Anonymous 2007-08-25 8:57 ID:H+UGOQMq

>>4
time_t n = time(NULL);
PROBLEM SOLVED.

>>2
int main(int argc, char **argv){
 for(;;sleep(1)){
  /* do stuff */
 }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List