V
V
Vladislav Kolotsei2016-01-20 15:53:17
Java
Vladislav Kolotsei, 2016-01-20 15:53:17

Is there a specific timeout for console input?

The point is the following. You need to ask the user for data from the console. Data must be entered within 10 seconds. That is, if the user does not enter data within 10 seconds, the program continues on. How can this be done using threads?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexxandr, 2016-01-20
@alexxandr

thread 1: starts waiting for console input and waits for it
thread 2: waits 10 seconds, then kills thread 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question