Skip to content

Commit 8deb9ca

Browse files
committed
Small tweaks and a new example.
1 parent 2ab9d5d commit 8deb9ca

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

example-1.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ function doTimeout() {
1515
}
1616

1717
const asyncDebugger = new AsyncDebugger();
18-
asyncDebugger.notifyComplete(() => console.log("All done!"));
18+
asyncDebugger.notifyComplete(() => console.log("********** All done! **********"));
1919
asyncDebugger.startTracking("test-1", doTimeout);
20+
21+
console.log("End of script");

example-2.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
console.log("Timeout finished.");
16+
}, 2000);
17+
}
18+
19+
const asyncDebugger = new AsyncDebugger();
20+
asyncDebugger.notifyComplete(() => console.log("********** All done! **********"));
21+
asyncDebugger.startTracking("test-1", doTimeout);
22+
23+
console.log("End of script");

0 commit comments

Comments
 (0)