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

  • : 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...
  • : : 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?
  • : : : 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.
  • 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.
  • you can use just an empty for loop
    like below,
    for(i=0;i<10000;i++)
    {}
    it will create the delay in your program
  • include <unistd.h>

    int usleep(useconds_t usec);

    Please note that the parameter is the number of microseconds to sleep

Sign In or Register to comment.

Howdy, Stranger!

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

Categories