Java 查看运行程序线程数

来源:互联网 发布:逆战最新源码 编辑:程序博客网 时间:2024/04/30 07:38
//获取线程数ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();while(threadGroup.getParent() != null){threadGroup = threadGroup.getParent();}int totalThread = threadGroup.activeCount();System.out.println(totalThread);

0 0
原创粉丝点击