Question:

How can I execute a statement after a certain amount of time in C#?

by  |  earlier

0 LIKES UnLike

In one case I want to give the user a chance to input information, but if they don't after a few milliseconds I want the code to continue.

In the second case I simply want a delay between output statements. How do I do this?

 Tags:

   Report

1 ANSWERS


  1. Use :

    Thread.sleep( the number of milliseconds to wait )

    For example :

    int waitForMilliseconds = 1000 ; // which is one second

    Thread.sleep( waitForMilliseconds )

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.