Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
int iterationCounter = 0;
while(true){
//todo
iterationCounter++;
if(stopWatch.ElapsedMilliseconds >= 1000){
Console.WriteLine("iterations "+iterationCounter);
break;
}
}
stopWatch.Stop();