ubuntu中的c ++睡眠函数 [英] sleep function for c++ in ubuntu

查看:993
本文介绍了ubuntu中的c ++睡眠函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,我希望程序延迟100毫秒,因为它们是dos.h中的延迟功能.
同样,我想知道使用ubuntu在c ++中是否存在用于延迟几毫秒的功能.

hi friends i want a delay of 100 milliseconds in my program as their is delay function in dos.h
likewise i want to know is there any function in c++ for delay of some milliseconds im using ubuntu.

推荐答案

您可以使用usleep .它有点类似于Windows版本,只是它以微秒为单位接受参数.

http://linux.die.net/man/3/usleep [
You could use usleep. It''s kinda similar to the Windows version except that it takes arguments in microseconds.

http://linux.die.net/man/3/usleep[^]

(Thanks to Albert Holguin for the edit)


我会说:创建一个无信号的等待对象,并等待超时.
问候.
I would say: create a non signaled wait object and wait for it with timeout.
Regards.


你好,我无法得到你的礼物,请照亮
hello mbue im not able to get you will you please illustate


这篇关于ubuntu中的c ++睡眠函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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