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:04:50 +0100 Lines: 31 Message-ID: References: <5189ddb2-f717-40ed-8ab7-d58f84427d8eo@googlegroups.com> <2ed575bd-296e-43df-92ab-09265c196d8bo@googlegroups.com> <84d6ebe8-9a2c-4d91-875f-54f98b5e27b8o@googlegroups.com> <2b5e551d-6a60-48e1-9ade-a8f693709ee7o@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net GJqqR5v+aq4vI2t2eDr7ZQqCps6fI9LMBa3BZV9p7h1z8iFJjS Cancel-Lock: sha1:c44aZVcTpLBJsd4yn52LDDzaw9c= In-Reply-To: <2b5e551d-6a60-48e1-9ade-a8f693709ee7o@googlegroups.com> Xref: csiph.com comp.lang.javascript:39099 Jonas Thörnvall: > Den söndag 1 november 2020 kl. 21:22:41 UTC+1 skrev Arno Welzel: >> Jonas Thörnvall: >> >> [...] >>> I do not know how Javascript resolving it being single threaded, but i slightly remember some technic called polling. It seem javascript polling tecknic to UI maybe do to many calls out? I could accept a hundred times slower, like polling values every 1/100 of second but 1000 to 100 000 times slower seem ridiculous. >> >> "Polling" means to actively read values instead of reacting to an event >> or message. And yes, JavaScript can "poll" values from the UI very fast. >> >> However: setInterval() will *not* work with 0ms. The delay will usually >> be limited to a minium value as it makes no sense to constantly fire an >> event handler without any delay. >> >> -- >> Arno Welzel >> https://arnowelzel.de > > I do not think you understand the problem or i totally do it backward, tell me which.... > > The timer doing no polls it doing function call using intervals to flip coins got it?????? Yes - but you tried to use setInterval() with a delay of 0ms to keep a function running to poll to UI and then complained that JavaScript is slow when polling the UI. -- Arno Welzel https://arnowelzel.de