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

Thread: thread sleep

  1. #1
    Join Date
    Dec 2001
    Location
    Dallas, Tx, USA (originally fromIndia)
    Posts
    154

    thread sleep

    Hi,
    i am using C++ and pthreads. from what i understand, sleep() puts the thread to sleep in units of 1 second. what can i do if i need millisecond intervals.
    Appreciate the help
    Thanks,
    Preetham.

  2. #2
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    Try nanosleep.

    sleep isn't reliable on some versions of Unix (eg Solaris 2.6) as it uses SIGALRM, which may also be used by the thread mechanism.
    Succinct is verbose for terse

  3. #3
    Join Date
    Nov 2002
    Posts
    30
    usleep()

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