{"author_name":"hitoto28","url":"https://hitoto28.hatenablog.com/entry/2023/10/17/192424","type":"rich","description":"\u4ed6\u8a00\u8a9e\u3067\u8a00\u3046\u3068\u3053\u308d\u306e wait \u3068\u304b sleep \u3068\u304b\u3092JS\u3067\u3084\u308a\u305f\u3044\u3059\u3054\u304f\u3088\u304f\u4f7f\u3046\u306e\u3067\u6539\u3081\u3066\u30e1\u30e2ES2017\u4ee5\u964d\u306a\u3089\u2193 const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); // 2\u79d2\u5f85\u6a5f await sleep(2000); \u305d\u308c\u3088\u308a\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306a\u3089\u2193 function sleep(waitMsec) { var startMsec = new Date(); // \u6307\u5b9a\u30df\u30ea\u79d2\u9593\u3060\u3051\u30eb\u30fc\u30d7\u3055\u305b\u308b\uff08CPU\u306f\u5e38\u306b\u30d3\u30b8\u30fc\u72b6\u614b\uff09 while (new Date() - startMsec < waitMs\u2026","height":"190","blog_title":"onsen code monkey","published":"2023-10-17 19:24:24","blog_url":"https://hitoto28.hatenablog.com/","width":"100%","author_url":"https://blog.hatena.ne.jp/hitoto28/","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhitoto28.hatenablog.com%2Fentry%2F2023%2F10%2F17%2F192424\" title=\"\u3010JavaScript\u3011\u306a\u308b\u3079\u304f\u30b7\u30f3\u30d7\u30eb\u306b\u6570\u79d2\u9593\u5f85\u6a5f\u3055\u305b\u308b\u51e6\u7406 - onsen code monkey\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","categories":["JavaScript"],"title":"\u3010JavaScript\u3011\u306a\u308b\u3079\u304f\u30b7\u30f3\u30d7\u30eb\u306b\u6570\u79d2\u9593\u5f85\u6a5f\u3055\u305b\u308b\u51e6\u7406","image_url":null,"version":"1.0"}