Skip to content

Commit c06042c

Browse files
committed
New example.
1 parent 8deb9ca commit c06042c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

example-3.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// Run me with --expose-gc
3+
//
4+
// node --expose-gc example.js
5+
//
6+
7+
const { AsyncDebugger } = require("./lib/async-debugger");
8+
9+
console.log("Starting up!");
10+
11+
function doTimeout() {
12+
console.log("Starting timeout.");
13+
14+
setTimeout(() => {
15+
16+
setTimeout(() => {
17+
console.log("Timeout finished.");
18+
}, 2000);
19+
20+
}, 2000);
21+
}
22+
23+
const asyncDebugger = new AsyncDebugger();
24+
asyncDebugger.notifyComplete(() => console.log("********** All done! **********"));
25+
asyncDebugger.startTracking("test-1", doTimeout);
26+
27+
console.log("End of script");

0 commit comments

Comments
 (0)