Question:

How can I set a delay in java???source code please?

by  |  earlier

0 LIKES UnLike

How can I set a delay in java???source code please?

 Tags:

   Report

2 ANSWERS


  1. int seconds = 10 ; // to delay 10 seconds

    int milliSeconds = seconds * 1000 ;

    Thread.sleep(milliSeconds);


  2. use Thread.sleep(1000);

    1000 is the number of milliseconds (or seconds) that the program will pause.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.