js es6 实现 sleep 阻塞

export default {
	async sleep(time){
	    return new Promise((resolve) => setTimeout(resolve, time));
	}
}
posted @ 2023-09-15 14:13  bitterteaer  阅读(90)  评论(0编辑  收藏  举报