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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:52:06+00:00 2026-06-18T02:52:06+00:00

I am currently developing an application, I would like to implement a time delay.

  • 0

I am currently developing an application, I would like to implement a time delay. I don’t want to use System.Threading.Thread.Sleep(x); as I read this stalls the thread (UI freezes)

The code I have currently written is:

public void atimerdelay()
{
    lblStat.Text = "In the timer";
    System.Timers.Timer timedelay;
    timedelay = new System.Timers.Timer(5000);
    timedelay.Enabled = true;
    timedelay.Start();
}

I know atimerdelay() does get called (using lblStat), but their is no delay of 5 seconds. I have read http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx but I can’t work out why the above code is not working.

Additional information – (added for Hamlet Hakobyan)

The application is a ‘card checker’ application (University project – no real information is used or stored). Once the user has filled out all the relevant and click ‘check’ a list of validation methods are called. Before any of these are called a ping is carried out to make sure a live internet connection is on the computer. I want to add a slight delay between the ping and the starting of the validation.

  • 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-18T02:52:07+00:00Added an answer on June 18, 2026 at 2:52 am

    How about:

    await Task.Delay(5000)
    

    ? It won’t block UI thread and looks pretty good!

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

Sidebar

Related Questions

I am currently developing a J2EE application and I would like to use Jetty.
I'm currently developing a web application based on jQuery Mobile. I would like to
i would like to ask you for an advice. I'm currently developing application in
I would like to implement per-directory quotas for a multi-user web application we're developing.
I'm currently developing an application with spring-mvc and I would like to work with
I'm currently developing an application using Symfony 2 and would like my routes to
I am currently developing an iOS Messenger application and I would like to talk
I am currently developing an android application with Eclipse. I would like to be
Im currently developing my first application in PyQt4, and what i would like to
I'm currently developping a JavaEE application using glassfish, and I would like to save

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.