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

  • Home
  • SEARCH
  • 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 7812847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:38:45+00:00 2026-06-02T04:38:45+00:00

Is it possible to run some code in C# , wait a few seconds,

  • 0

Is it possible to run some code in C# , wait a few seconds, then keep going? I know you can use a timer but is there an easier, quicker way? Like in batch you can do:

echo Hello
ping localhost -n 10 > nul
echo World
pause > nul

So can I do this in C# , and would it work with Winforms or just Console, because I need it for Winforms…
[edit] i need to have only a single method to pause, but the rest of the app still continue. For example if i have a button, click, and 5 seconds later continue the rest of the method that was called. Yet in the meantime, still be able to push other buttons?

  • 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-02T04:38:46+00:00Added an answer on June 2, 2026 at 4:38 am

    Begininvoke?

    new Action(() => {
        Console.WriteLine("Waiting...");
        Thread.Sleep(10000);
        Console.WriteLine("Over");
    }).BeginInvoke(null, null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to run some code when an assembly is loaded, without doing
Is it possible to extend the PHP echo so that I can run some
Is it possible to write and run with Visual Studio 2008 some unit test
I would like to track (run some code - or invoke function) when the
I would like to run some code (perhaps a function) right before every function
I have a library and I want to run some code when an item
Is it possible to somehow know when a UserControl is unloading and take some
Lets say I need to run some initialization code everytime I match a rule
I want to have a page run some PHP code when a user clicks
My input is javascript code that I can pre-process.. at some specific point in

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.