Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
parsadev805y@blackfaded Why there isn't any sleep like function in javascript without complicated codes?
-
function sleep(time) {
return new Promise(resolve => {
setTimeout(()=> resolve(), time));
}
}
...
await sleep(6000); -
@parsadev Because JavaScript is inherently single threaded and doesn't have fibers so the control flow can't just halt in place
-
parsadev805y@12bitfloat hmmm, Looks like you're a js expert, I have a question, what are atomic processes in javascript, I don't get them?
and somewhere I had seen that they can be used to make an sleep function to stop the hole thread. -
@b3b3 do tags do anything on devrant anyway? except maybe classifying something as rant or not rant?
-
Hazarth94765yI know how this feels. We had a problem where the *landing page* for our app took 18s to load, After much optimization I took it down to 6... Its not great but you have to understand thing shit was in development for over 6 years and the client is an idiot
-
@parsadev I'm not actually a JS expert, lol
What do you mean with 'atomic processes' I can't seem to find much about that
Related Rants
I am the LAW bro:)
joke/meme
python
programming
nodejs
test
movie
developer
javascript
testing
computer
code
js