Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

kbhit & delay

Status
Not open for further replies.

mlara

Programmer
Oct 22, 2001
32
CO
Hello. I have a problem with a little c program. I don't know how do a 'delay'. Also I don't know what function could be equal or similar to kbhit(). You remerber that the libraries conio.h & dos.h it's not available in Linux.

Thanks, for your help.
 
Ok, thanks you, but I would want know a function that was compatible with Win32 (2000 Server).

Thanks you.
 
if you use sleep(<value>); you will free up the processor until the time expires. If you dont know the delay and want the user to have interaction to stop the delay then use getch.

Matt
 
How I can combine sleep() & getch()?
 
Why do you want to combine them?
If you want a delay in seconds, use
Code:
sleep()
.
If you want a delay until user interaction, use
Code:
getch()
.
Both of them free up the processor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top