Compare commits
2 Commits
d00ff5fff8
...
98718f1797
Author | SHA1 | Date |
---|---|---|
Kai Sellmann | 98718f1797 | |
Kai Sellmann | fbbe88224c |
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
public class ThreadAuslesen {
|
||||||
|
|
||||||
|
public static void main(String[] agrs) {
|
||||||
|
// Anzahl der Prozessoren auslesen
|
||||||
|
var nr = Runtime.getRuntime().availableProcessors();
|
||||||
|
System.out.println("Anzahl der Prozessoren auf diesem Rechner: " + nr);
|
||||||
|
// Weitere Daten aus aktuellen Thread lesen
|
||||||
|
var self = Thread.currentThread();
|
||||||
|
System.out.println("Name: " + self.getName());
|
||||||
|
System.out.println("Prio: " + self.getPriority());
|
||||||
|
System.out.println("ID: " + self.threadId());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue