且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何让我的 C# 程序休眠 50 毫秒?

更新时间:2021-09-22 22:22:55

System.Threading.Thread.Sleep(50);

但请记住,在主 GUI 线程中执行此操作会阻止您的 GUI 更新(它会感觉缓慢")

Remember though, that doing this in the main GUI thread will block your GUI from updating (it will feel "sluggish")

只需删除 ; 即可使其也适用于 VB.net.

Just remove the ; to make it work for VB.net as well.