f4_yellowjacket
03-01-2003, 04:43 PM
hey everyone, I'm fairly new to c, but I love it (way more than c++). I'm doing a lab where I'd like to have a loop for 5 second. How do I set up a timed loop for mandrake and if it's any different how do i do it for redhat.
I think is want i have so far it compiles but doesn't run.
#define LOOP_TIME 5
time_t startTime;
startTime = time(NULL);
while ((time(NULL) - startTime) <= LOOP_TIME) {}
I don't have it in front of me but i think that's what I have so far.
Thanks very much
Mike
I think is want i have so far it compiles but doesn't run.
#define LOOP_TIME 5
time_t startTime;
startTime = time(NULL);
while ((time(NULL) - startTime) <= LOOP_TIME) {}
I don't have it in front of me but i think that's what I have so far.
Thanks very much
Mike