Investigation of optimal sleep time calculation in game loop

前端 未结 5 640
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 08:47

When programming animations and little games I\'ve come to know the incredible importance of Thread.sleep(n); I rely on this method to tell the operating system

5条回答
  •  情话喂你
    2020-12-08 08:53

    Timing stuff is notoriously bad on windows. This article is a good place to start. Not sure if you care, but also note that there can be worse problems (especially with System.nanoTime) on virtual systems as well (when windows is the guest operating system).

提交回复
热议问题