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

Threaded View

  1. #1
    Join Date
    May 2001
    Posts
    153

    Inserting a delay ...

    I have the following code for inserting a delay in the program:

    Code:
    #include <time.h>
    void CreateHPGL::sleep( clock_t wait )
    {
       clock_t goal;
       goal = wait + clock();
       while( goal > clock() );
    }
    and I use it like this:
    Code:
    sleep(20000); // for a 20 second delay
    It works fine on windows, however, on unix, there is no delay. Can someone point out the problem for me?

    Kamran
    Last edited by kaftab; June 26th, 2002 at 04:11 PM.

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