with a time interval like 60 seconds or so
60s is rather less then things like Windows Task Scheduler is set up for – it can do it via the advanced settings (once per day and repeat every one minute.
One open question is what to do if a run of the task takes longer than the scheduler interval? Can two runs overlap or not? Assuming they can overlap something as simple as:
var timer = new System.Threading.Timer(method, null,
TimeSpan.Zero, // Start now.
TimeSpan.FromSeconds(60));
where method is a delegate of type TimerCallback: takes an object state (null passed above) and returns nothing.
If you do not want to allow calls to overlap should the next task be skipped or delayed, assuming skipped:
var object locker = new object();
var timer = new System.Threading.Timer(_ => {
bool entered = Monitor.TryEnter(locker);
try {
if (entered) {
method(null);
}
} finally {
if (entered) {
Monitor.Exit(locker);
}
}
}, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
(where, again, method is the worker code).