Jump to content

Is game.time.elapsed always guaranteed to be in milliseconds?


binarez
 Share

Recommended Posts

Hi,

 

I'm using game.time.elapsed to update my game entities. They are expecting frame delta time in milliseconds (ms). It seems to work. On all platforms, will elapsed be in milliseconds? Am I using game.time.elapsed correctly?

 

Thanks for the awesome engine.

Link to comment
Share on other sites

Ok, I guess no one else is using game.time.elapsed?

 

What are you using to get time per frame? I'm looking to get a value in milliseconds (number) so I can pass that to update my entities. Thanks for any info!

Link to comment
Share on other sites

I went and did some digging : http://gametest.mobi/phaser/docs/Time.js.html#sunlight-1-line-107

 

So elapsed seems to be the difference between last frame's milliseconds timestamp vs this frame's... exactly what I need.

 

Extra references:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now

https://developer.mozilla.org/en-US/docs/Web/API/Performance.now%28%29

Link to comment
Share on other sites

  • 4 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...