Pausing a timer using setitimer?

In C, is there a way to start a timer using setitimer, then pause it, and then resume the timer with the remaining time when it was paused? My initial thought was to save the time left with getitimer, stop the timer, then set the timer back to the saved value in getitimer, but that doesn't seem to work.

+3
source share
1 answer

You cannot pause the timer. Saving the remaining time, stopping the timer, and starting a new timer is a way to do this. This method works, so I think you have an error in your code.

+1
source

All Articles