Howdy, Stranger!

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

Categories

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 Member Posts: 1,784
    : 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 Member Posts: 2
    : : 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 Member Posts: 1,784
    : : : 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 Member Posts: 1
    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 Member Posts: 1
    you can use just an empty for loop
    like below,
    for(i=0;i<10000;i++)
    {}
    it will create the delay in your program
  • rollerolle Member Posts: 115

    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.