Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

delay() function in gcc

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..

Comments

  • IDKIDK Posts: 1,784Member
    : 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...
  • mitchimitchi Posts: 2Member
    : : 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?
  • IDKIDK Posts: 1,784Member
    : : : 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.
  • Sanky1983Sanky1983 Posts: 1Member
    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.
  • sarfrajkhansarfrajkhan Posts: 1Member
    you can use just an empty for loop
    like below,
    for(i=0;i<10000;i++)
    {}
    it will create the delay in your program
Sign In or Register to comment.