Getting the current thread info

Report a typo

Implement a function that prints the information about the thread executing this function. The information includes the thread's name and its priority.

Don't forget to specify the data in the output. Look at the example to better understand the output format.

Here is the output example:

name: my-thread
priority: 5

Tip: The function should not accept any arguments.

Sample Input 1:

th-test 10

Sample Output 1:

name: th-test
priority: 10
Write a program in Kotlin
fun printCurrentThreadInfo() {
// get the thread and print its info
}
___

Create a free account to access the full topic