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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:34:33+00:00 2026-05-23T14:34:33+00:00

Possible Duplicate: Chrome: timeouts/interval suspended in background tabs? Is there a minimum allowed delay

  • 0

Possible Duplicate:
Chrome: timeouts/interval suspended in background tabs?

Is there a minimum allowed delay for setInterval() and setTimeout() when being run on a tab you’re not currently looking at?

This code runs setInterval() with a specified delay of 100ms and writes out how long the delay actually was. It also reports when you enter/leave the tab.

<html>
<body>
<script type="text/javascript">

window.onfocus = function () { document.body.innerHTML += 'entered tab<br />'; };
window.onblur = function () { document.body.innerHTML += 'left tab<br />'; };
var previous = new Date().getTime();
setInterval(function () {
    var now = new Date().getTime();
    var elapsed = now - previous;
    document.body.innerHTML += elapsed + '<br />';
    previous = now;
}, 100);

</script>
</body>
</html>

Here’s an excerpt of the output on Chrome 12.0.742.100 on Ubuntu 10.04.2 LTS:

101
101
101
left tab
1001
1000
1004
1003
1002
1000
entered tab
101
101
101
102
101

I tried different values for the delay too. Any value less than 1000 results in the same behavior of it being raised to 1000 when you’re looking at a different tab. Values over 1000 behave correctly. And the same thing happens with the setTimeout() version of this code.

  • 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-23T14:34:33+00:00Added an answer on May 23, 2026 at 2:34 pm

    I know your example was for Chrome, but for Firefox at least, from the Firefox 5 Release Notes (under “What’s New in Firefox”).

    Background tabs have setTimeout and
    setInterval clamped to 1000ms to
    improve performance


    Oh, and I just realised this has already been asked in regard to chrome, over here: Chrome: timeouts/interval suspended in background tabs?. There’s a link there that shows that this is also true in Chrome.

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

Sidebar

Related Questions

Possible Duplicate: How to remove border around text/input boxes? (Chrome) Is there a way
Possible Duplicate: How do I stop Chrome from yellowing my site's input boxes? i
Possible Duplicate: Bizarre console.log behaviour in Chrome Developer Tools Given the following script :
Possible Duplicate: Is there some ninja trick to make a variable constant after its
Possible Duplicate: HTML 5 Geo Location Prompt in Chrome I've been looking at geolocation
Possible Duplicate: css @font-face not working with firefox, but working with chrome and IE
Possible Duplicate: Google Chrome - Alphanumeric hashes to identify extensions I'm building a Chrome
Possible Duplicate: How to add google chrome omnibox-search support for your site? I have
Possible Duplicate: Chrome Dev Tools - Size vs Content What is the difference between
Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? I write next js

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.