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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:07:18+00:00 2026-06-10T16:07:18+00:00

Specifically talking about (server side) V8, and assuming I’m not concerned about accuracy because

  • 0

Specifically talking about (server side) V8, and assuming I’m not concerned about accuracy because I can detect and compensate for it, could I literally set up thousands of relatively simple timeouts several seconds apart from each other using setTimeout without facing any other limit other than RAM? Is there any catch I should be aware of if I were to use a system where there may be thousands of scheduled timeouts at any given time?

For the record I’ve read John’s Resig excellent article on How Javascript Timers work so no need to point out anything that’s already covered there 🙂 I’m aware node.js is single threaded, timers can block other timers if they take too long, etc.

PS: I’m strictly trying to understand how viable is what I describe, no need to point out “there’s surely a better way to do what you intend to do!”.

  • 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-10T16:07:19+00:00Added an answer on June 10, 2026 at 4:07 pm

    The only real world limit you may come up against is the amount of memory available to node. Use the following code to test. I successfully ran the example below using oneMillion and int32Max. When using int64Max, I received the following error from node. I’m using 64bit windows with 4gb of RAM.

    FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory
    

    Node code to test:

    var util = require('util');
    var int64Max = 9007199254740992; 
    var int32Max = 2147483647;
    var oneMillion = 1000000;
    var tenThousand = 10000;
    var counter = 0;
    
    //Exchange the limiter with one of the above vars to test.
    for (var i = 0; i < oneMillion; i++){   
         setTimeout(log, 1);
         //Required as the timeout/callback method will not be called until the loop ends due 
         //to node/js being single threaded.
         util.log('loop:' + i);
    }
    
    function log(){
         util.log('callback: ' + counter++);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am specifically talking about physical RAM, I do not want virtual memory stats
EDIT: Specifically talking about querying against no table. Yes I can use exists, but
I'm talking specifically about the public, private and protected keywords that can apply to
I came across a section on MSDN this evening talking about #pragma options. Specifically,
For those of you who do not know what I am talking about: http://www.teamviewer.com/images/presse/quickconnect_en.jpg
The code function that I'm specifically talking about is getCount(). There are several other
That may seem like a broad question, but I'm talking specifically here about apps
Specifically I'm talking about Python. I'm trying to hack something (just a little) by
I'm specifically talking about the IE embedded script language PerlScript from ActiveState. I currently
Specifically, Python is unable to find SQL Alchemy. Running easy_install does not help, as

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.