wait, but note that most browsers will not allow it on the browser's main thread. If you do want a blocking construct, see this answer using Atomics. ![]() ![]() This means it does not block the execution of the rest of the script, which is what you want in the vast majority of the cases. await only pauses the current async function.await can only be executed in functions prefixed with the async keyword, or at the top level of your script in an increasing number of environments.Return new Promise(resolve => setTimeout(resolve, ms))
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |