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 6247641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:54:47+00:00 2026-05-24T12:54:47+00:00

Is it possible to make an object that has its own setInterval(); I have

  • 0

Is it possible to make an object that has its own setInterval();

I have this code here http://jsfiddle.net/mLHJr/1/ with a global setInterval. I want to have multiple instances of the circle object and each own to have its own interval with different framerate.

Is that possible?

Thanks in advance

  • 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-05-24T12:54:48+00:00Added an answer on May 24, 2026 at 12:54 pm

    There are a variety of approaches. You can use one timer and have it call an update function for each object in an array or collection. Or you can create separate objects that call their own update function and have their own timer.

    The first option is usually more efficient.

    You have another issue though – if each circle has its own timer, you can’t just re-draw the entire canvas each time as you are doing now. If you do, then each time it re-draws one ball it will delete the others so it will flicker between them. You can fix that by having the ball delete only itself before redrawing itself in the new location – but then you have to deal with overlapping balls.

    So the best approach is one timer that re-draws all the balls each time in sequence so the ones “on top” always overlap the ones underneath.

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

Sidebar

Related Questions

How is it possible to make prototype methods in C#.Net? In JavaScript, I can
Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0?
Is it possible to make it appear to a system that a key was
Is it possible to make such buttons ( http://img225.imageshack.us/img225/6452/buttonslw9.jpg ) using CSS? It should
Is it possible to make efficient queries that use the complete regular expression feature
Hi I have an application that operations like this.. Client <----> Server <----> Monitor
Problem for me is to implement clone for an object. This object A has
This is beyond both making sense and my control. That being said here is
I have a class object that stores some properties that are lists of other
I'm currently employed at a small ASP.NET/MS-SQL shop. My team has noticed that a

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.