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: Mon, 2 Nov 2020 01:09:09 +0100 Lines: 28 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 //jlmeIcRElcK2RoOmlqZARxcvttON5AoFb9KUCDH0cMFpZVEC Cancel-Lock: sha1:wo8hc3EIYwht5Yl+/Bb1oSKlT04= In-Reply-To: Xref: csiph.com comp.lang.javascript:39100 Jonas Thörnvall: > Den söndag 1 november 2020 kl. 21:17:32 UTC+1 skrev Arno Welzel: >> 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 > > Yeah i could accept 100 times overhead, but not 1000-100 000 something is wrong. How did you calculate this factor exactly? -- Arno Welzel https://arnowelzel.de