Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Doing what you suggest, the timing for function calls using setInterval is just awful slow why????? Date: Sun, 1 Nov 2020 21:17:23 +0100 Lines: 16 Message-ID: References: <5189ddb2-f717-40ed-8ab7-d58f84427d8eo@googlegroups.com> <2ed575bd-296e-43df-92ab-09265c196d8bo@googlegroups.com> <88c8cc71-f3f5-44d0-8c26-144c09782636o@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net mskbFuYFJTRx4oRB0ibogwqwfOv1MgUPuY1VdoM2w4P2zzH5Wj Cancel-Lock: sha1:B4AYvRfaXAoNwAgdlwa4S7intEc= In-Reply-To: <88c8cc71-f3f5-44d0-8c26-144c09782636o@googlegroups.com> Xref: csiph.com comp.lang.javascript:39093 Jonas Thörnvall: [...] > Here is an example using setInterval 0 ms can you say why it run 1000-10000 times slower then if just run thru a loop. Why do you expect that setInterval() with 0 ms will cause code to run with no delay at all? Even with 0 ms there is overhead to trigger the interval handler. Of course this is slower than just running something without any delay in a loop. -- Arno Welzel https://arnowelzel.de