summaryrefslogtreecommitdiff
path: root/node_modules/webworker-threads/examples/quickIntro_blocking.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/webworker-threads/examples/quickIntro_blocking.js')
-rw-r--r--node_modules/webworker-threads/examples/quickIntro_blocking.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/node_modules/webworker-threads/examples/quickIntro_blocking.js b/node_modules/webworker-threads/examples/quickIntro_blocking.js
new file mode 100644
index 0000000..fedb97f
--- /dev/null
+++ b/node_modules/webworker-threads/examples/quickIntro_blocking.js
@@ -0,0 +1,13 @@
+function fibo (n) {
+ return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;
+}
+
+(function fiboLoop () {
+ process.stdout.write(fibo(35).toString());
+ process.nextTick(fiboLoop);
+})();
+
+(function spinForever () {
+ process.stdout.write(".");
+ process.nextTick(spinForever);
+})();