I'm developing a C# program that needs to be able to schedule a variety of asynchronous tasks at different times. I need a solution that activates every second to check for tasks to execute, and eats up as few resources as possible. It also needs to scale well to a large number of tasks. Which of these is better to use, or is there any ?
1) Using a System.Timers.Timer object with a 1 second elapsed time to trigger an event that executes tasks, or
2) Using a separate thread that sleeps for 1 second and then executes tasks when it wakes up, or
3) Something else entirely.