我的意思是如果Sleep()的时间不是很长例如Sleep(100),
那么线程被挂起时耗费的时间和线程重新恢复执行要花费的时间
有没有可能接近100甚至超过100呢?
在哪些情况下调用这个函数才有必要呢?
那么线程被挂起时耗费的时间和线程重新恢复执行要花费的时间
有没有可能接近100甚至超过100呢?
在哪些情况下调用这个函数才有必要呢?
解决方案 »
- CPictureEx 画gif图片 背景色问题
- 请问用VC++ 怎么实现上下浮动的菜单面板,就像打开我的电脑左边的那个一样
- CInternetSession,打开连接后的关闭,怎么操作
- 在单文档程序中 产生一个对话框 但是在Debug中停留时产生的信息不知道是什么意思?
- 刚找到工作就接到棘手的任务,希望高手指点
- CButton上的文字的颜色是怎么设的??
- 怎样才能列举出生成AVI文件的所有压缩选项,功能如:AVISaveOptions函数
- 做完全屏后,做ESC退出全屏!按技术文档做,但还是退不出来。请看代码!
- 关于获取串口号和在Combox下拉列表中显示问题
- 如果现在已经连入网络,通过什么API 我能知道是哪个网络适配器连入到internet呢?
- 请教stdafx.h头文件的问题
- 怎么用ADO增加修改SQL SERVER中的INT类型?涉及VARIANT
A thread can relinquish the remainder of its time slice by calling this function with a sleep time of zero milliseconds. You have to be careful when using Sleep and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. If you have a thread that uses Sleep with infinite delay, the system will deadlock. Two examples of code that indirectly creates windows are DDE and COM CoInitialize. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than Sleep.
sleep(0)都有
或者可以写个sleep(0)
然后profile看看,它占用了多少cpu时间
profile 是什么意思?怎么做?
然后build->profile
但好像不是每个工程都能profile,有人知道什么时候一定能profile吗
This error can occur if the file, subdirectory, or disk on which it resides is read-only. In this case, make the file writable or move the file to a writable disk. See your operating system documentation for information on removing the read-only attribute from a file.
This error may be caused by not having enough file handles. Close some open applications and recompile.
Trying to open a file or directory for which you do not have permission can cause this error. Move the file to a directory where you do have access privileges, or ask your network administrator to grant you access to the file.
If an include file could not be opened, check that the INCLUDE environment variable is set correctly and that the name of the file is spelled correctly.
Using double quotation s around a complete path specification in a #include directive causes the standard directories to NOT be searched. See The #include Directive in the Preprocessor Reference for more information.