Need microsecond delay in .NET app for throttling UDP multicast transmission rate

后端 未结 6 1663
遇见更好的自我
遇见更好的自我 2020-12-15 12:37

I\'m writing a UDP multicast client/server pair in C# and I need a delay on the order of 50-100 µsec (microseconds) to throttle the server transmission rate. This helps to a

6条回答
  •  执笔经年
    2020-12-15 13:08

    I would discourage using spin loop as it consumes and creates blocking thread. thread.sleep is better, it doesn't use processor resource during sleep, it just slice the time. Try it, and you'll see from task manager how the CPU usage spike with the spin loop.

提交回复
热议问题