Re: unix timer

Or, in this case, since you know your sleep() is going to get interrupted every second, it's kind of pointless to even use sleep() at all... Just use pause(), and then check the value of "i" to see how long you've been asleep... Ie:

for (;;) {
pause();
if ((i % 30) == 0)
printf ("Value of %d\n", i);
}

Also, please remember to use the code tags around large blocks of code for better readability...