How can I create a delay in Visual C++?

what is the coding that will create a delay in microsoft visual C++.


Comments

  • : what is the coding that will create a delay in microsoft visual C++.




    There's a Windows function Sleep that takes, as its only parameter, an integer for the number of milliseconds to sleep.


  • : what is the coding that will create a delay in microsoft visual C++.




    try this:


    void delay(unsigned int waitMilli)

    {

    unsigned int timeNow = clock();



    while ( clock() - timeNow <= waitMilli );<p>
    cout << flush;//this not needed but it helps sometime with cout's <br>
    }


    Hope it helps






Sign In or Register to comment.

Howdy, Stranger!

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

Categories