我们可以直接在VS2010 C ++中使用sleep()吗? [英] Can we directly use sleep() in VS2010 C++

查看:496
本文介绍了我们可以直接在VS2010 C ++中使用sleep()吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将VS2010 C ++中的sleep()函数用作延迟函数.
但是我发现它不起作用.

I am trying to use sleep() function in VS2010 C++ as a delay function.
But I find it doesn''t work.

推荐答案

Sleep(DWORD)[^] certainly works, though it''s normally the wrong solution :)

A few rules of using Sleep

1. Don''t ever do it on the UI thread
2. Don''t use Sleep, wait on an object
3. See #2


这篇关于我们可以直接在VS2010 C ++中使用sleep()吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆