I'm writing an app using C# for a user to log their time usage of programs. They can pick processes and they are stored in a database.
The app is currently using a timer at a 5 second interval to loop through every running process on the device using Diagnostics.Process.GetProcesses()
and checking this list of names against the ones in the database.
Is this a reasonable way to go about this? Or would it be better to create a thread for each process in the database that listens for it to start using Win32Process.ProcessInfo.StartedEventHandler()
?