Option 1 is the simplest, you just create a timer that will interrupt your program at regular intervals. You say you are programming in C but specify no platform, timers are platform dependent.
In Unixland, timers send signals to process upon completion. Specifically, a timer implementation for Linux is setitimer.
You then have to catch and handle the signals sent by the timer.
In the Win32 API you can use timers as well, but the concept is somewhat different.