I hope this helps you . I have no Java experience, but you should simply call the level1 method in another thread than the main thread. This way the program runs and the thread.sleep is only there for the level1 method.
µs-precision wait in C for linux that does not put program to sleep?
like below fixes the issue Achieving this low resolutions (less than 1ms) is almost impossible in conventional multitasking operating systems without hardware support, but there is a software technique which could help you. (I've tested it before) Software delay loop isn't accurate solution because of processes preemption by operating system's scheduler. But you can patch your kernel with RT_PREEMPT and enable it via CONFIG_RT_PREEMPT, now you have a kernel with realtime scheduling support, the realtime kernel let you run a process with realtime priority, the process with realtime priority run until it wants nobody could preempt it, so if you run a delay loop the process will not preempted by operating system so you could created accurate delays with these loops.
Java, how to make program wait for video to end and then continue and wait() makes program stop
This might help you Can you get the videos length? Because Java is able to read the meta data of some files... You can try to use a timer instead to wait for the video to finish. Maybe you can get the length of the video and set a timer to call the same function (recursion) with a different parameter and play the other video. So basically make the function take the path as parameter, and play the video of that parameter. If you don't know already, Java has a Timer class where a timer instance takes an amount of seconds and a function to call in its constructor, and it has a .play() method.
How to make a thread wait for another one in linux?