Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:05:23+00:00 2026-06-11T14:05:23+00:00

I need to wait some time in one of my threads, I started to

  • 0

I need to wait some time in one of my threads, I started to think about WaitForSingleObject but it needs handles to wait on, although it can take a timeout input;

Another resolution may use SetTimer but it seems that it will create WM_TIMER message but I don’t have change to catch that message since I am in a thread, so is there something I can use here ? can I use Sleep?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:05:24+00:00Added an answer on June 11, 2026 at 2:05 pm

    The proper method strongly depends on what you mean with to wait some time. The Sleep function and the WaitForSingleObject function are basically of the same accuracy.
    Depending on the underlaying hardware and the version of the OS minimum delays achievable are in the range of 0 .. 1 .. 20ms. If you desire to just wait for seconds or 10th of seconds these two functions are the right choice.

    Waiting for shorter periods in time i.e. in the millisecond range needs more detailed investigation. See this or this answer for more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to run two ffmpeg commands, one after the other i.e., wait until
I have an application with one main thread and N worker threads. At some
In pthread_create I can specify one message, then on run time I may get
I think I may need to re-think my design. I'm having a hard time
I am doing a media file scan using sendBroadcast. Then I need to wait
I need a way to wait until a (Swing) JComponent is fully painted. This
I need files to be downloaded to /tmp/cron_test/. My wget code is wget --random-wait
I have a php script I need to run every 5 seconds (run, wait
Need some regular expressions help. So far I have my code working to allow
In my ASP.NET MVC application I have a number of threads that wait for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.