I will start off by describing what I want to achieve. The idea is that I have multiple objects of a class with their own different timers. When a timer for an object runs out, I want that object to print a message to the console and then reset the timer. I would like this to run in the background so that my Application can keep working while these multiple timers run in the background.
For example initialise like so (where argument is the timer in seconds):
BackGroundTimer timer1 = new BackGroundTimer(1);
BackGroundTimer timer2 = new BackGroundTimer(2);
BackGroundTimer timer3 = new BackGroundTimer(3);
Console.ReadLine();
Where Console.ReadLine() symbolizes ongoing work. Then I would ideally like to have the following outputs:
0:
1: Timer1
2: Timer1 Timer2
3: Timer1 Timer3
4: Timer1 Timer2
Is this possible to achieve?