I have a requirement to pause a while loop for a specific number of milliseconds. I have tried using Thread.sleep(duration) but it is not accurate, especially in a looping s
Try a ScheduledThreadPoolExecutor. It's supposed to give more reliable timing results.