I am nwe to C# thread. I have a heartbeat class which will run in a thread
like this:

Class Heartbeat
{
private int miRate;
private int miCount = 0;

public Heartbeat(int Rate) { this.miRate = Rate; }

public void Start() {
while ( true )
{
Thread.Sleep( 1 ) // sleep 1 second
if ( this.miCount++ >= this.miRate )
Console.WriteLine("Heartbeat {0}", DateTime.Now);
else
this.miCount = 0;
}
}

public void Reset()
{
this.miCount = 0;
}
}

After I create a Heartbeat obj and start it in a thread, I do need to call
Reset sometimes to reset the heartbeat. However, it does not run correctly.
What happens if the thread is in sleep mode while calling its Reset mothod?
Is Reset still accessible? How can I reset the heartbeat correctly?

D. Chu