setitimer(ITIMER_REAL, &value, 0);
getitimer(ITIMER_REAL,0,0)
int count;
for( count=0; ((count<LOOP_LIMIT) && (sigcount<40)); count++ ){
if (count%5000000 == 0)
printf("Time goes by...count=%d\n", count);
}
if (int value==0)
printf("An Alarm just went off!",sigcount++);
printf( "At the end, count=%d and alarms=%d\n", count, sigcount );
return 0;
}
for homework im supposed to modify it that every time the registered timer expires,the program prints "An alarm went off!" and then increments the value of the variable sigcount.
then after that im supposed to use setitimer(ITIMER_REAL,0,0); which will disable the real timer(if set) to modify the program after the 5 alarms have been recieved.
I know my code is not even close to being right and i desperately need help.Please,if anybody knows how i can fix this mess can you show me with the actual code to do it in.I know im supposed to learn this on my own,but if i have no clue what im doing,im not learning anything either.......please help.