News

The java.util.concurrent approach also introduced the ability to set time units explicitly rather than specifying everything in number of milliseconds. This is available via the TimeUnit enum .
The main class in structured concurrency is java.util.concurrent.StructuredTaskScope. The Java 21 documentation includes examples of how to use structured concurrency.