Created
December 16, 2017 03:08
-
-
Save dmitrykolesnikovich/12903b763cdc141f207e9f9d63af4a56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set<Thread> threads = Thread.getAllStackTraces().keySet(); | |
for (Thread t : threads) { | |
String name = t.getName(); | |
Thread.State state = t.getState(); | |
int priority = t.getPriority(); | |
String type = t.isDaemon() ? "Daemon" : "Normal"; | |
System.out.printf("%-20s \t %s \t %d \t %s\n", name, state, priority, type); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment