locked
how to make fix time delay in c RRS feed

  • Question


  • i want to create a 1 sec delay in c program . anyone can explain how to do that.
    or any other delay functions..??
    Saturday, November 17, 2007 9:25 AM

Answers



  • u can make call delay function like this....

    int call_delay(N)
    {
      int s;
      for(s=0;s<=N;s++)
        {
        }
      return (0);
    }



    or you can use sleep() function for 1 sec delay.
    asm("sync") for syncronous delay...

    or u can create ur own..


    Saturday, November 17, 2007 1:21 PM

All replies



  • u can make call delay function like this....

    int call_delay(N)
    {
      int s;
      for(s=0;s<=N;s++)
        {
        }
      return (0);
    }



    or you can use sleep() function for 1 sec delay.
    asm("sync") for syncronous delay...

    or u can create ur own..


    Saturday, November 17, 2007 1:21 PM
  • thanks for sharing us for this function.
    Sunday, November 18, 2007 6:53 AM
  • what does that delay function do?
    i mean what does every line does?
    Saturday, January 2, 2010 2:42 AM