Putting it in a timer is probably your best solution, but which timer class to use may depend on this: Are you doing a console app, Winforms, or WPF? For Winforms use Timer.
For wpf use DispatcherTimer: WPF Timer Like C# Timer
In response to your clarifying comment, for services see this answer: Best Timer for using in a Windows service