You could use a System.Timers.Timer
to run every second and check whether some task is to be run. Like this for example:
private System.Timers.Timer _timer;
_timer = new System.Timers.Timer();
_timer.Interval = 1000;
_timer.AutoReset = false; // Fires only once! Has to be restarted explicitly
_timer.Elapsed += MyTimerEvent;
_timer.Start();
private void MyTimerEvent(object source, ElapsedEventArgs e)
{
DateTime now = DateTime.Now;
// Check for tasks to be run at this point of time and run them
...
// Don't forget to restart the timer
_timer.Start();
}
In the timer method you may have to truncate the seconds. You'll also need to make sure that the task is not run every second during the minute you want it to run at.