I am writing a WPF application using C#. I need the application to continue to run for two minutes and then perform some maintenance. The user may not be interacting with it so user driven events are not guaranteed.
What is the event I should be monitoring to fulfill this requirement?
Here is some pseudo code of what I am considering:
public partial class MainWindow : Window
{
void RegularTimelyEventOccoured() {
if (timer >= 2 minutes) {
DoMaintenance();
}
}
}