delay() function in gcc - Programmers Heaven

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