Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Write to two separate arrays in realtime. Date: Sat, 21 Sep 2019 11:48:47 +0200 Lines: 15 Message-ID: References: <6df2cfcb-3e7a-4a51-90d0-0b21474b77c8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net jzaSJLrgDiAIBs/6EawBqw0ROCs926XVx4WaOwt6v74egU9VSJ Cancel-Lock: sha1:iBVrzDfuv7a1a/z5b63A3aHNrnw= In-Reply-To: <6df2cfcb-3e7a-4a51-90d0-0b21474b77c8@googlegroups.com> Xref: csiph.com comp.lang.javascript:37313 Jonas Thörnvall: > I write to an array in realtime to record keystrokes. > I would like an array with identical "elements", that i can also edit in realtime and use for rendering purpose. > > How do i achieve this, tried to call "write" sequential to another function workArray but it seem flaky do not work? You can't - JavaScript running in a browser is not suitable for realtime applications as even processing an event will take 10-20 ms. You need align the events to "time slots" e.g. 1/10th or 1/20th of a second. -- Arno Welzel https://arnowelzel.de