Object-Oriented Programming · Confluent · Medium
Build a delayed-task scheduler capable of managing several tasks, where each task runs after its specified delay in milliseconds. Whenever schedule(runnable, delayTime) is called, print a line showing the task's delay and its expected execution time. For instance, scheduling task 2 with a delay of 2000 milliseconds must produce: After that delay has passed and the task starts, print: After every task has finished, print the message below to show that the scheduler thread is…