<div dir="ltr">Hello,<br><br>I was experimenting with the custom scheduler feature, trying to integrate it into the open-source library I maintain. For the core part of this library to work we need to have control/intercept certain parts of the environment, relevant here are:<br><br>1. How threads are scheduled and executed<br>2. The current time<div>3. How threads sleep<br><br>Since the JVM does not provide a good way to customize these we have to disallow users from using many normal Java standard library functions and instead they have to use our custom functions that do allow this. For example, users have to call `Workflow.sleep` instead of `Thread.sleep`.<br><br>Experimenting with the custom schedules it seems like we now could control how threads are scheduled and executed (amazing!), but we still can't control the current time or how threads sleep. For example if a thread with a custom scheduler calls `Thread.sleep` there is no way for the scheduler to control when that will return, even if the scheduler tries to unpark the thread the `for` loop in `VirtualThread.sleepNanos` will keep parking it. In other languages that support a custom scheduler for tasks like Python, Javascript, Dotnet, Rust or Ruby this sort of behaviour is customizable. <br><br>Is there a way currently to customize this behaviour that I have missed or would this be something the team would be open to exploring in the future?<br><br>Thanks,<br>Quinn</div></div>