Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:02:26+00:00 2026-06-05T10:02:26+00:00

I am developing an application using Processing.js. At each step in the drawing loop

  • 0

I am developing an application using Processing.js.

At each step in the drawing loop I increment the number of frames by one frame++ .

I want to know how much time has passed. Currently to get the time passed (knowing that my application is set to run on 60FPS) I do like so: time=frame/60 . But this only works if the application always run at exactly FPS and we all know that’s not the case cause it depends on the users hardware.

I want the timer to be pretty accurate (having only like 0.0001s error).

Suggesting some javascript algorithm for calculating the difference between now() and start_time() is also welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:02:28+00:00Added an answer on June 5, 2026 at 10:02 am

    You can store the start time at a variable.

    Then create a new timer whenever you want and subtract the start time variable from it..
    The result will be the difference in milliseconds..

    You can also use the actual time divided by the frames counter to get an accurate average frame-rate of your application..

    something like

    var startTimer = new Date(); // at start (once)
    

    and whenever you want to check

    var passed = new Date() - startTimer; // in milliseconds
    

    Demo at http://jsfiddle.net/gaby/CF4Ju/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing one application using C# for processing MSWord files. My application gets
I am developing an application using symfony2. I would like to know how I
I am developing application using J2ME and LWUIT.I want to run this application on
I am developing one web application using CakePHP , I will be providing one
I'm in the process of developing a multi-tiered financial processing application in Java using
im developing windows application using c#. i want to close the application and show
Hi i am developing real time image processing application on android. I am using
I want to add logging to an application I am developing, using apache log4j.
I am developing a sound processing application using Qt as a front end. How
I'm developing an algorithmic trading application using complex event processing and I'm looking into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.