Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

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)
 
Share this answer
 
v3
Comments
Albert Holguin 24-Apr-11 19:05pm    
made a small correction, but good response and link
Nish Nishant 24-Apr-11 19:09pm    
Thanks Albert. I edited it again to remove the strike-through text and the edit-info as it will confuse the OP and other readers. I did add a small line acknowledging your correction. I trust that's alright!
Albert Holguin 24-Apr-11 19:11pm    
No prob :)
I would say: create a non signaled wait object and wait for it with timeout.
Regards.
 
Share this answer
 
v2
hello mbue im not able to get you will you please illustate
 
Share this answer
 
Comments
Albert Holguin 24-Apr-11 17:00pm    
don't post follow up questions as solutions, post as comment in his solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900