Sign in to follow this  
FastClick

How to set FPS to 30?

Recommended Posts

You cannot set the render cycle of the browser to do 30fps - it will always align itself to 60fps because thats the framerate the monitor runs with as well. Calculating more than 60fps would be a waste of calculations.

 

However, if you WANT your game to run at 30fps, you can simply skip every 2nd frame and do nothing there. But why would you want to do that?

Share this post


Link to post
Share on other sites

Limiting the FPS is not going to fix an issue like that. Even oposite you should've try setting the FPS higher if possible :)

 

So best way is to share code and upload the game so we others can test and tell what the cause of the lag maybe is.

Also chrome profiler is good tool to see what eats most memory:

 

Check this:

http://www.html5rocks.com/en/tutorials/canvas/inspection/

and this:

http://www.realtimerendering.com/blog/webgl-debugging-and-profiling-tools/

 

 

A frame represents a single pass through the your page's event loop. This involves running JavaScript, handling events, updating the DOM, style changes, performing layout and painting & compositing the page. For smooth animation, you want each frame to take less than 1/60th of a second, or 16.6 ms.

Share this post


Link to post
Share on other sites

What kind of lag do you have? Usually lag = lower FPS.

What you can do is take some timestamps before and after expensive methods and get some timings. JS is single threaded, so if you block somehow the FPS will go down. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.