package org.kodejava.lang.management;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
public class ThreadCount {
public static void main(String[] args) {
// Get the managed bean for the thread system of the Java
// virtual machine.
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
// Get the current number of live threads including both
// daemon and non-daemon threads.
int threadCount = bean.getThreadCount();
System.out.println("Thread Count = " + threadCount);
}
}
Latest posts by Wayan (see all)
- How do I create a table with multiple header in iText 8? - March 16, 2024
- How do I add Image to a Table in iText 8? - March 11, 2024
- How do I downgrade Android SDK emulator version? - February 12, 2024