I wanted to replace a counter based while loop with the timer based while loop in C#.
Example :
while(count < 100000)
{
//do something
}
to
while(timer < X seconds)
{
//do something
}
I have two types of timers in C# .NET for this System.Timers
and Threading.Timers
.
Which one will be better to use and how.I don't want to add extra time consumption or threading issues with the timer.