summaryrefslogtreecommitdiff
path: root/node_modules/webworker-threads/examples/quickIntro_blocking.js
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-04-04 01:00:59 -0700
committeryo mama <pepper@scannerjammer.com>2015-04-04 01:00:59 -0700
commitc7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 (patch)
tree8546df448afef40d3814d2581f4dacff7cebb87f /node_modules/webworker-threads/examples/quickIntro_blocking.js
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);
+})();