protected override void OnStart(string[] args) { timer.Elapsed += new ElapsedEventHandler(OnElapsedTime); //This statement is used to set interval to 1 minute (= 60,000 milliseconds) timer.Interval = 60000*2; //enabling the timer timer.Enabled = true; } protected override void OnStop() { timer.Enabled = false; } private void OnElapsedTime(object source, ElapsedEventArgs e) { while (true) { MessageBox.Show("hello there!"); System.Threading.Thread.Sleep(60 * 2000); } }
60000*2
60 * 2000
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)