I need to delay some piece of code from processing for some time in Microseconds. I tried a lots of things such as thread.Sleep(x), but it has only milliseconds resolution.

I am using .NET 2.0 in MS Visual Studio 2013.

有帮助吗?

解决方案

 System.Diagnostics.Stopwatch

allows you to get very small (few nanosecond) ticks, which you can convert to microseconds using this. Then you can just let an empty while loop for as long as you need.

Edit: and it even is supported by .NET 2.0.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top