java thread.sleep() do not make processor time available to the other threads when I test

When I do work with Thread.sleep(),I found when current thread invoking sleep() method,other threads could not obtain the processor time to invoke their own.But I get the sleep() method's information from Oracle's doc conversely,so I'm confused.

Here is my code:

class ThreadTest {

private Runnable mRunnable = () -> {

println("from runnable start run");

println("from runnable start end");


private class TestThread extends Thread {


public void run() {;

println("from Thread start run");

try {


} catch (InterruptedException e) {



println("from Thread end");



private void println(String info) {

System.out.println(getDate() + " : "+info);


private String getDate() {

SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间

sdf.applyPattern("yyyy-MM-dd HH:mm:ss a");// a为am/pm的标记


Read More »

By: StackOverFlow - Friday, 9 November

Related Posts