You can also use the DateTime.Now.Ticks counter:
long start = DateTime.Now.Ticks; TimeSpan duration = TimeSpan.FromMilliseconds(1000); do { // } while (DateTime.Now.Ticks - start < duration);
However, this seems like an expectation. This means that the cycle will make one core of your processor work 100%. This will slow down other processes, speed up aso fans. Although it depends on what you intend to do, I would recommend including Thread.Sleep(1) in the loop.
source share