Search code examples
c#scheduling

Scheduling algorithm


I want a certain job executed every 4 days starting from a start date and ending at an end date (or it can even never end). I could have different scheduling configurations, monthly, weekly, daily, even have daily recurrence like every 2 hours from 2 PM to 11 PM.

I'm looking for algorithms, code examples, etc.


Solution

  • A cron daemon fulfills this purpose on unix-derived platforms. You could take a look into anacron's source code for details on a possible implementation of such a scheduler.