You need the sleep method of the Thread class.

public static void sleep (long time)

Causes the thread which sent this message to sleep for the given interval of time (given in milliseconds). The precision is not guaranteed – the Thread may sleep more or less than requested.

Parameters

time The time to sleep in milliseconds.

Leave a Reply

Your email address will not be published. Required fields are marked *