Java - alternative to thread.sleep

前端 未结 8 666
礼貌的吻别
礼貌的吻别 2020-11-30 10:00

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

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 10:27

    If you want to be accurate with sounds you use a sequencer and set the tempo in BPM: sequencer.setTempoInBPM(120);

提交回复
热议问题