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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:49:35+00:00 2026-06-07T09:49:35+00:00

This is the Mozilla Developer Network example of window.setInterval var intervalID = window.setInterval(func, delay[,

  • 0

This is the Mozilla Developer Network example of window.setInterval

var intervalID = window.setInterval(func, delay[, param1, param2, ...]);
var intervalID = window.setInterval(code, delay);

(which can be found here: https://developer.mozilla.org/en/DOM/window.setInterval)

I’m more used to compiled Java programming of these types of algorithms so my question is:

How does intervalID work? It seems that there is some kind of recursive function going on there behind the scenes but that’s a complete guess – how is it structured and is that structure (presumably quite large) stored as intervalID, waiting for clearInterval(intervalID)?

  • 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-07T09:49:37+00:00Added an answer on June 7, 2026 at 9:49 am

    I’m just going to assume that you want to know how it works in the Firefox browser (each browser has its own implementation of the same method). The implementation can be found in nsGlobalWindow::SetTimeoutOrInterval() and it is actually pretty straightforward. Each window has a list of outstanding timeouts and when you call window.setInterval() a new timeout structure is created and added to that list. The timeout structure contains a reference to the timer object that will notify the window whenever the callback needs to called. And it has an mPublicId member that is simply a number – it gets incremented for each new timeout created and is returned by setInterval(). When you call clearInterval() it will look up a timeout with matching ID in the list and remove it.

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

Sidebar

Related Questions

I am practicing this https://developer.mozilla.org/en/Canvas_tutorial/Basic_animations Clock tutorial. Everything in the code is clear to
From the Mozilla Developer Network : [1,4,9].map(Math.sqrt) will yield: [1,2,3] Why then does this:
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty states: configurable : True if and only if the type of this property
[EDIT: this question is about Mozilla Audio Data API which is no longer considered
I have this code in my index.php. In Mozilla its ok. But in Ie
I'm reading the Mozilla developer's site on closures, and I noticed in their example
I'm learning javascript and was going through an example here: https://developer.mozilla.org/en/A_re-introduction_to_JavaScript function personFullName() {
I've read this article on MDN: https://developer.mozilla.org/en/Places_utilities_for_JavaScript#Bookmark_Dialog But still has no clue how to
I'm writting some code to explore the bookmarks of Firefox ( https://developer.mozilla.org/en/Retrieving_part_of_the_bookmarks_tree ) and
I have this code here: var fields = row.split(/regex goes here/); I want to

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.