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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:43:53+00:00 2026-05-22T22:43:53+00:00

I have several instances in my application. Each of these instances have a Timer

  • 0

I have several instances in my application. Each of these instances have a Timer object which will trigger the object’s own method after an amount of time.

As this would be a simple simulation app, I intend to allow it to have a pause/continue simulation feature as well as an “step up/down speed” feature to the timers.

However, if all my instances have their own individual Timer objects, they will all run independently on their own and it is difficult to ask all these objects to pause and then continue. Even if I were to loop through a list of array to call every instances to pause/continue its timer, this definitely isn’t a very efficient way to do things. This same problem applies for stepping up and down the overall speed of the timers.

It seems like I should have only one single timer in the simulation world that will control all of the instances but again, this would make things very complex as well.

What are some of the implementation methods to achieve such requirements? I am using Java for my application.

Thanks!

  • 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-22T22:43:54+00:00Added an answer on May 22, 2026 at 10:43 pm

    You could always use an event-driven approach. Have each object register as a listener of the main controller and when an option is changed, just trigger an event and let all of the instances update themselves.

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

Sidebar

Related Questions

I have a service which is running in a system in several instances. I
I have a NSMutableArray pages with several objects (instances of Page ). Each Page
I have a Silverlight application that consists of a MainWindow and several classes which
I have written several test classes to test a web application using testng. Each
The root problem: I have an application which has been running for several months
I have an application where there several threads each pumping into a separate AudioTrack
I have an user control, which contains multiple methods and each of these methods
I have several different packages, one for each logical part of my application. Some
In our application we have several (actuall many, about 30) web services. Each web
We are currently developing a distributed JavaEE application. Several JBoss instances will be spreaded

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.