JavaScript 이벤트 루프 시각화
콜 스택, 태스크 큐, 마이크로태스크 큐와 함께 JavaScript 이벤트 루프를 시각화합니다.
console.log("Start");
setTimeout(() => {
console.log("setTimeout");
}, 0);
Promise.resolve().then(() => {
console.log("Promise");
});
console.log("End");느림빠름
대기콜 스택
(비어있음)
Web APIs / 타이머
(비어있음)
마이크로태스크 큐
(비어있음)
태스크 큐 (매크로태스크)
(비어있음)
(비어있음)
콜 스택
마이크로태스크 큐
태스크 큐 (매크로태스크)
Web APIs / 타이머
콘솔 출력
JavaScript 이벤트 루프 이해하기
JavaScript 이벤트 루프는 비동기 작업을 처리하는 메커니즘입니다. setTimeout 콜백은 태스크 큐에, Promise 콜백은 마이크로태스크 큐에 들어갑니다.
핵심 개념
- 콜 스택은 동기 코드를 먼저 실행
- 마이크로태스크는 매크로태스크보다 우선
- 각 매크로태스크 후 모든 마이크로태스크 실행
- 콜 스택이 비었을 때만 큐 확인
- Web API는 메인 스레드 외부에서 실행
자주 묻는 질문
관련 도구
이 도구 평가
3.8 / 5 · 109 개 평가
최신 소식 받기
주간 개발 팁과 새 도구 알림을 받으세요.
스팸 없음. 언제든 구독 해지 가능.
Enjoy these free tools?
☕Buy Me a CoffeeHow to Use
- Enter or paste your data in the input field
- Configure any options if available
- Click the action button to process
- Copy the result to your clipboard
Use Cases
- Development and debugging workflows
- Data format conversion
- Code generation and formatting
- Quick calculations and validation