diff --git a/README.md b/README.md index a4d0c09b..959341d2 100644 --- a/README.md +++ b/README.md @@ -102,10 +102,11 @@ No. An instance of goja.Runtime can only be used by a single goroutine at a time. You can create as many instances of Runtime as you like but it's not possible to pass object values between runtimes. -### Where is setTimeout()? +### Where is setTimeout()/setInterval()? + +setTimeout() and setInterval() are common functions to provide concurrent execution in ECMAScript environments, but the two functions are not part of the ECMAScript standard. +Browsers and NodeJS just happen to provide similar, but not identical, functions. The hosting application need to control the environment for concurrent execution, e.g. an event loop, and supply the functionality to script code. -setTimeout() assumes concurrent execution of code which requires an execution -environment, for example an event loop similar to nodejs or a browser. There is a [separate project](https://github.com/dop251/goja_nodejs) aimed at providing some NodeJS functionality, and it includes an event loop.