How to let System.Windows.Forms.Timer to run the Tick handler immediately when starting?

Viewed 18405

The Timer following is System.Windows.Forms.Timer C# Code:

Timer myTimer = new Timer();
myTimer.Interval = 10000;
myTimer.Tick += new EventHandler(doSth);
myTimer.Start();

The timer will doSth every 10 seconds, but how to let it doSth immediately when starting?

I tried to create a custom timer which extends Timer, but I can't override the Start method.

For now, my code is:

myTimer.Start();
doSth(this, null);

I don't think it's good. How to improve it?

3 Answers
Related