It better crash on start, how many threads do you think that's going to make? Put conditions, don't let it loop infinitely.
Technically, that code won't crash "instantly", but the while loop will run many times before a single second has even passed and it'll crash from all the threads it's made.
Sorry i forgot to mention i already thought it mightve been because of the infinite loop so i tested it under conditions but it still crashed.
Thankfully i found the solution, it seems that the thread goes out of scope and terminates the
program. I detached it with the thread.detach(); command and it did the job