Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
查看 LWJGL wiki 上显示的计时器后,毫秒还不够快。它使播放器的速度不一致。我找不到任何关于如何产生更准确的计时器的信息,比如 3.2 毫秒而不是 3 毫秒。我知道这听起来很愚蠢,但我真的被困住了。
您可以使用 System.nanoTime():
long startTime = System.nanoTime(); //Stuff in-between long timeTaken = System.nanoTime() - startTime;