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

  • Home
  • SEARCH
  • 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 7054491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:37:59+00:00 2026-05-28T03:37:59+00:00

I have a scenario where one client PC will be driving multiple LCD displays,

  • 0

I have a scenario where one client PC will be driving multiple LCD displays, each showing a single browser window. These browser windows show different data which is on an animated cycle, using jquery.

I need to ensure that both browsers can be synched to rotate at exactly the same time, otherwise they’ll animate at different times.

So my question is – can I trigger jquery to alternate the content based on the local PC clock?

eg each time the clock seconds == 0, show version 1, each time clock seconds == 30, show version 2 etc?

  • 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-28T03:37:59+00:00Added an answer on May 28, 2026 at 3:37 am

    This is (in my experience) the most precise way of getting timers to trigger as closely as possible to a clock time:

    // get current time in msecs to nearest 30 seconds
    var msecs = new Date().getTime() % 30000;
    
    // wait until the timeout
    setTimeout(callback, 30000 - msecs);
    

    Then, in the callback, once everything is done, do the same again to trigger the next event.

    Using setInterval causes other problems, including clock drift. The calculation based on the current time accounts for the time executing the callback itself.

    You’ll still also need to use Date().getTime() as well to figure out which frame of your animation to show.

    The whole thing would look something like this:

    function redraw() {
        var interval = 30000;
    
        // work out current frame number
        var now = new Date().getTime();
        var frame = Math.floor(now / interval) % 2; // 0 or 1
    
        // do your stuff here
        .. some time passes
    
        // retrigger
        now = new Date().getTime();
        setTimeout(redraw, interval - (now % interval));
    }
    
    redraw();
    

    working demo at http://jsfiddle.net/alnitak/JPu4R/

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

Sidebar

Related Questions

We have a scenario where multiple devices are connected to one com port. Each
Say I have a simple client/server scenario with one method: // client code $client
I have a scenario where a user will have access to a one-time-url. When
I have a scenario where multiple users will be doing import processes, but all
My scenario: I have one color background image JPG. I have one black text
I have a similar scenario as this one: public class TestLinq2Xml { private XElement
I have a scenario where I need to upload a file from one web
Scenario I have two wrappers around Microsoft Office, one for 2003 and one for
I have the following scenario: Entities are loaded from the database. One of them
Here's the scenario: I have 2 tables with data, one is the 2009 version

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.