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 267295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:31:39+00:00 2026-05-11T23:31:39+00:00

I need to do a sort of timeout or pause in my method for

  • 0

I need to do a sort of “timeout” or pause in my method for 10 seconds (10000 milliseconds), but I’m not sure if the following would work as i do not have multi-threading.

Thread.Sleep(10000);

I will try to use that current code, but I would appreciate if someone could explain the best and correct way of doing this, especially if the above code does not work properly. Thanks!

UPDATE: This program is actually a console application that in the function in question is doing many HTTPWebRequests to one server, so I wish to delay them for a specified amount of milliseconds. Thus, no callback is required – all that is needed is an “unconditional pause” – basically just the whole thing stops for 10 seconds and then keeps going. I’m pleased that C# still considers this as a thread, so Thread.Sleep(…) would work. Thanks everybody!

  • 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-05-11T23:31:39+00:00Added an answer on May 11, 2026 at 11:31 pm

    You may not have multi-threading, but you’re still executing within a thread: all code executes in a thread.

    Calling Thread.Sleep will indeed pause the current thread. Do you really want it to unconditionally pause for 10 seconds, or do you want to be able to be “woken up” by something else happening? If you’re only actually using one thread, calling Sleep may well be the best way forward, but it will depend on the situation.

    In particular, if you’re writing a GUI app you don’t want to use Thread.Sleep from the UI thread, as otherwise your whole app will become unresponsive for 10 seconds.

    If you could give more information about your application, that would help us to advise you better.

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

Sidebar

Ask A Question

Stats

  • Questions 121k
  • Answers 121k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is no need to group absolutely everything. This looks… May 12, 2026 at 12:34 am
  • Editorial Team
    Editorial Team added an answer The second is the preferred way especially if you can… May 12, 2026 at 12:34 am
  • Editorial Team
    Editorial Team added an answer Ok, after about a day of fiddling with it, I… May 12, 2026 at 12:34 am

Related Questions

EDIT: I'm still waiting for more answers. Thanks! In SQL 2000 days, I used
I've never been completely happy with the way exception handling works, there's a lot
A problem I've encountered a few time in my career is in a tiered
I'm running into a common pattern in the code that I'm writing, where I
This is a pretty low level question...I'm trying to do a performance test of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.