Search code examples
androidmobileeaseljscreatejs

How to get real FPS with createjs


I created a game with createjs, but it runs very slowly on a mobile.

I added a function to show FPS obtained with createjs.Ticker.getMeasuredFPS(). However, the FPS shown by the function is quite normal. I set the FPS to 60, and the result of getMeasuredFPS() is about 55-60, while the animation is laggy and the FPS shouldn't be so high (it might be 5-10).

How can I get the real FPS on the device?

How can I profile it on a mobile?


Solution

  • getMeasuredFPS() is well tested, and should be accurate. That said, there's always a chance your mobile browser is doing something tricky (running the code every tick, but not rendering). There's also a chance your code may not be updating properly.

    Either way, it's worth looking at a couple of alternatives. You can check getMeasuredTickTime(), which will tell you the average time spent in each tick (see the docs for more info).

    You should also take a look at profiling using devtools. http://google.com?q=profile+mobile+chrome