/// <summary>
/// 微秒级延迟,会稍有偏差
/// </summary>
/// <param name="time">延迟时间 毫秒(除以1000即微秒,如输入参数0.05ms = 50us)</param>
/// <returns></returns>
public static double delayUs(double time)
{
System.Diagnostics.Stopwatch stopTime = new System.Diagnostics.Stopwatch();
stopTime.Start();
while (stopTime.Elapsed.TotalMilliseconds < time) {}
stopTime.Stop();
return stopTime.Elapsed.TotalMilliseconds;
}
https://www.cnblogs.com/Mars-0603/p/15325199.html