sleep(), usleep()和[NSThread sleepForTimeInterval:]
来源:互联网 发布:强矩阵管理模式 编辑:程序博客网 时间:2024/06/16 16:28
引用一段stackoverflow上的回答
sleep(3) is a posix standard library method that attempts to suspend the calling thread for the amount of time specified in seconds. usleep(3) does the same, except it takes a time in microseconds instead. Both are actually implemented with the nanosleep(2) system call.
The last method does the same thing except that it is part of the Foundation framework rather than being a C library call. It takes an NSTimeInterval that represents the amount of time to be slept as a double indicating seconds and fractions of a second.
For all intents and purposes, they all do functionally the same thing, i.e., attempt to suspend the calling thread for some specified amount of time.
原帖地址:http://stackoverflow.com/questions/3155586/what-is-the-difference-among-sleep-usleep-nsthread-sleepfortimeinterval
- sleep(), usleep()和[NSThread sleepForTimeInterval:]
- usleep 和 sleep
- Linux的sleep()和usleep()
- usleep()和sleep()的区别
- Linux的sleep()和usleep()
- usleep和sleep的区别
- [C++]sleep 和 usleep区别
- nanosleep和usleep和sleep和alarm
- sleep/usleep和多线程锁的注意事项
- Cocos2d-x 中的Sleep 和USleep
- linux的sleep()和usleep()的…
- linux的sleep()和usleep()的…
- sleep()、Sleep()、usleep()、delay()
- linux的sleep()和usleep()的使用和区别
- linux的sleep()和usleep()的使用和区别
- linux的sleep()和usleep()的使用和区别
- Linux的sleep()和usleep()的使用和区别
- linux的sleep()和usleep()的使用和区别
- 深入MFC中WM_COMMAND命令消息的传递
- 运行时创建多边形刚体
- siverlight datagrid 导出xml或csv格式,保持颜色一致性
- Android中Activity之间访问互传参数
- 用JS来控制键盘上的一些事件
- sleep(), usleep()和[NSThread sleepForTimeInterval:]
- DOM的用法,以及window.onload……eval()
- Xdebug安装与使用
- C#中的线程与同步 ManualResetEvent用法
- 给出三角形三顶点的坐标,求三角形面积
- AVL树的插入删除查找算法实现和分析-1(平衡因子法)
- Android SDK目录结构和工具介绍
- vc++6.0快捷键
- 二叉查找树递归遍历与非递归遍历