Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 정렬
- typeORM
- jest
- JavaScript
- AWS
- GIT
- flask
- MySQL
- Bull
- class
- nodejs
- cookie
- Queue
- nestjs
- mongoose
- Sequelize
- Nest.js
- react
- 자료구조
- game
- Dinosaur
- OCR
- dfs
- 게임
- Python
- TypeScript
- Express
- MongoDB
- 공룡게임
Archives
- Today
- Total
목록async/await (1)
포시코딩
Promise, async/await을 통한 순차실행 (2)
function setTimeoutFunc(time) { return new Promise((resolve, reject) => { setTimeout(() => { console.log(time, '에 해당하는 시간이 지났습니다.'); resolve(); }, time); }) } async function main() { // console.log('시작 되었습니다.'); // setTimeoutFunc(1000); // console.log('종료 되었습니다.'); console.log('시작 되었습니다.'); await setTimeoutFunc(1000); console.log('종료 되었습니다.'); } main(); 시작 되었습니다. 1000 에 해당하는 시간이 지났습니다. 종료 되었습니다.
JavaScript
2022. 12. 12. 14:50