CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to write a Delay(mseconds) function?

    How to write a function to delay for given number of miliseconds?
    The function will be called intensively once the app starts. So cpu usage has to be considered.
    Any hints? Thanks


  2. #2
    Guest

    Re: How to write a Delay(mseconds) function?

    Use the Sleep() function. The following two lines of code will suspend execution for 300 milliseconds.

    DWORD delay = 300; // Number of milliseconds to delay
    Sleep(delay);


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured