var _timer = new System.Timers.Timer(300000); // 5 minutes in milliseconds _timer.Elapsed += new ElapsedEventHandler(WindowWatch); _timer.Enabled = true;