The below class is from a .Net Windows Service. The method DoSomeDatabaseStuff takes 10 minutes when it starts the first time but when the time is elapsed this method does not get called again.
public class Test
{
public void Start()
{
DoSomeDatabaseStuff();
_oTimer = new Timer(60000);
_oTimer.Elapsed += OnTimeout;
_oTimer.AutoReset = true;
_oTimer.Start();
}
private void OnTimeout(object source, ElapsedEventArgs e)
{
DoSomeDatabaseStuff();
_oTimer = new Timer(60000);
_oTimer.Elapsed += OnTimeout;
_oTimer.AutoReset = true;
_oTimer.Start();
}
}