C/C++ on Linux/Unix

Moderators: Lundin
Number of threads: 314
Number of posts: 633

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
delay() function in gcc Posted by mitchi on 8 Sept 2007 at 3:00 AM
the delay() function is not available in gcc, are there any alternatives for me to use? I've been trying to look around for a week now, so if anyone can help me please.

thanks..
Report
Re: delay() function in gcc Posted by IDK on 8 Sept 2007 at 5:52 AM
: the delay() function is not available in gcc, are there any
: alternatives for me to use? I've been trying to look around for a
: week now, so if anyone can help me please.
:
: thanks..

I think it's called sleep...
Report
Re: delay() function in gcc Posted by mitchi on 8 Sept 2007 at 8:27 AM
: : the delay() function is not available in gcc, are there any
: : alternatives for me to use? I've been trying to look around for a
: : week now, so if anyone can help me please.
: :
: : thanks..
:
: I think it's called sleep...

sleep? is this a function or what?
Report
Re: delay() function in gcc Posted by IDK on 8 Sept 2007 at 11:04 AM
: : : the delay() function is not available in gcc, are there any
: : : alternatives for me to use? I've been trying to look around for a
: : : week now, so if anyone can help me please.
: : :
: : : thanks..
: :
: : I think it's called sleep...
:
: sleep? is this a function or what?
:

Yes, why didn't you search for it?

I now did and found it's posix.
Report
Re: delay() function in gcc Posted by Sanky1983 on 25 Oct 2011 at 3:47 AM
Hi there,
if you are using linux terminal or running code on linux
you can use sleep function by this way

sleep(1); // here passing parameter determines number of seconds

for milliseconds try this
sleep(0.1);


Sanket.
Report
Re: delay() function in gcc Posted by sarfrajkhan on 27 May 2012 at 8:10 PM
you can use just an empty for loop
like below,
for(i=0;i<10000;i++)
{}
it will create the delay in your program



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.