How to run a function in every 10 minutes with in the loop using c#?
<p>I am having a loop that continuously run a function based on some condition.
Now, i want to call that function every 10 minutes only within the loop.
And i am using Visual studio 2005 ..
My code is.. </p>

<pre><code>        while (boolValue == false)
        {

         Application.DoEvents();
         StartAction();    //i want to call this function for every 10 minutes only

        }
</code></pre>

<p>And i am used the System.Timers
 But it's not calling the function i don't know what's wrong..
My code is</p>

<pre><code>    public static System.Timers.Timer aTimer;
    while (boolValue == false)
        {

            aTimer = new System.Timers.Timer(50000);
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.AutoReset = false;
            aTimer.Enabled = true;

                     }

   private static void OnTimedEvent(object source, ElapsedEventArgs e)
    {
               Application.DoEvents();
              StartAction();
    }
</code></pre>

<p>plz help me..</p>
