how to write delay code in c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinaym
    New Member
    • Apr 2010
    • 1

    #1

    how to write delay code in c

    how to write delay code in c language.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    to perform an efficient delay you need to use a non standard function provided by the operating system for example sleep(...) in Linux or Sleep(...) in Windows.

    There is no standard way of efficiently delaying without using processor cycles.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      You need a nonstandard high-resolution elapsed-time function even if your delay function is inefficent and uses processor cycles. Either way, you are dependent on nonstandard OS-specific functions. Therefore, a delay function is inherently nonportable.

      Comment

      Working...