Convert “duration” “Unit” to milliseconds August 6, 2023 by Tarik You can use Duration for this: Duration.of(5, ChronoUnit.SECONDS).toMillis()