Merge pull request 'verschoben' (#1) from kts into main

Reviewed-on: #1
main
Kai Sellmann 2024-10-15 16:29:45 +02:00
commit 98718f1797
1 changed files with 14 additions and 0 deletions

View File

@ -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());
}
}