How can i execute the a particluar loop for specified time
Timeinsecond = 600 int time = 0; while (Timeinsecond > time) { // do something here }
May be the following will help:
Stopwatch s = new Stopwatch(); s.Start(); while (s.Elapsed < TimeSpan.FromSeconds(600)) { // } s.Stop();