c# - C# 中的时间延迟

标签 c# .net

下面的函数 系统.Threading.Thread.Sleep(); 以毫秒为单位延迟线程,并以整数值作为参数。是否有微秒级线程延迟的任何方法。或者 sleep 功能可以采用浮点值吗? 谢谢

最佳答案

没有。引用来自 85122 的 Will Dean

you can't meaningfully 'sleep' (i.e. relinquish your scheduled CPU) for such short periods. If you want to delay for some short time, then you need to spin, repeatedly checking a suitably high-resolution timer (e.g. the 'performance timer') and hoping that something of high priority doesn't pre-empt you anyway.

关于c# - C# 中的时间延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/903688/

相关文章:

c# - 如何序列化 WCF 响应中的嵌套类型?

c# - 线程化简单计算

c# - 如何在 SignalR 中从服务器发送定期消息

c# - linq to sql中如何判断是否使用join?

.net - Tidy.NET 的替代品?

C# 将字节数组转换为 int 总是相同的数字

c# - 负载测试服务器登录

c# - 使用Html.TextBoxFor时如何设置文本框的宽度

javascript - 大纪元 .NET 到 JavaScript(休息时间?)

c# - Premake 无法为 C# 库创建 Makefile