Thread.sleep() cannot be somewhere in the thread, it can be in the task code, so the task execution will block for 5000 ms and then run to completion.
Note that java.util.Timer is a single-threaded scheduler, and if a task execution is blocked Timer will not be able to execute other scheduled tasks. See API
Corresponding to each Timer object is a single background thread that is used to execute all of the timer's tasks, sequentially. Timer tasks should complete quickly. If a timer task takes excessive time to complete, it "hogs" the timer's task execution thread. This can, in turn, delay the execution of subsequent tasks, which may "bunch up" and execute in rapid succession when (and if) the offending task finally completes.
src.zipfile.