DevToolBox무료
블로그

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는 메인 스레드 외부에서 실행

자주 묻는 질문

이벤트 루프란?
이벤트 루프는 싱글 스레드 JavaScript에서 비차단 I/O를 가능하게 하는 동시성 모델입니다.
마이크로태스크와 매크로태스크의 차이?
마이크로태스크(Promise.then)는 우선순위가 높으며 각 매크로태스크 사이에서 처리됩니다.
왜 Promise.then이 setTimeout보다 먼저 실행?
Promise 콜백은 마이크로태스크로 매크로태스크보다 먼저 처리됩니다.
콜 스택이 비었을 때?
먼저 모든 마이크로태스크를 처리한 후 다음 매크로태스크를 처리합니다.
무료인가요?
네, 완전히 무료입니다.

관련 도구

𝕏 Twitterin LinkedIn

이 도구 평가

3.8 / 5 · 109 개 평가

최신 소식 받기

주간 개발 팁과 새 도구 알림을 받으세요.

스팸 없음. 언제든 구독 해지 가능.

Enjoy these free tools?

Buy Me a Coffee

How to Use

  1. Enter or paste your data in the input field
  2. Configure any options if available
  3. Click the action button to process
  4. Copy the result to your clipboard

Use Cases

  • Development and debugging workflows
  • Data format conversion
  • Code generation and formatting
  • Quick calculations and validation

FAQ

Is this Javascript Event Loop Visualizer tool free to use?
Yes, the Javascript Event Loop Visualizer tool is completely free. No registration or payment required.
Is my data secure?
Absolutely. All processing happens client-side in your browser. Your data never leaves your device or is sent to any server.
What formats does the Javascript Event Loop Visualizer tool support?
The tool supports all standard formats for IP address calculation. Check the tool interface for specific format options.

💬 User Feedback

Have suggestions or found a bug? Leave a message and we'll get back to you.
0/2000