Hello, I wanted to know how to execute one thread after another for a certain time, for example:
Thread x = new Thread(() -> {
// qualquer código, pode ter até um while(true)...
});
Thread x2 = new Thread(() -> {
// qualquer código, pode ter até um while(true)...
});
I have a thread x that should run for 3s, after that time it should pause and then x2 should start, but it can not contain any additional code inside its runnable. Thank you in advance.