...
Code Block | ||
---|---|---|
| ||
int do_work(int seconds_to_work) { time_t start = time(0); if (start == (time_t)(-1)) { /* Handle error */ } while (time() < start + secondseconds_to_work) { do_some_work(); } } |
...
...
Code Block | ||
---|---|---|
| ||
int do_work(int seconds_to_work) { time_t start = time(0); if (start == (time_t)(-1)) { /* Handle error */ } while (time() < start + secondseconds_to_work) { do_some_work(); } } |
...