Why does is this code executed faster in a thread pool with 1 thread compared to one with more

You need to remember that creating and managing threads is not free. In general you should parallelize only CPU-intensive tasks that benefit from being run in parallel. In your case, the task is not using CPU and even does not emulate using CPU (for that you would have to use Thread.sleep instead of delay). This means that all tasks are finished exactly 7500 ms after the start. Everything else is the overhead of creating run jobs and dispatching them. The more threads you use, the more overhead.

6 Likes