Will you get the time slice as soon as the java timer timer time arrives?

in other words, will the timer be executed as soon as the cpu time is up, or do you need to wait for other threads to give up the cpu?
is this the same as Thread.sleep ()?

Mar.03,2021

what happens if your computer has only one core and two timers at the same time are turned on at the same time?

it's good to think for yourself before asking questions


that is to say, when the time comes for timer and thread.sleeep (), will the situation be the same? Except for one that excludes the time during the execution of the task, and one that does not rule out, everything else is the same, right?

Menu