Skip to content

Commit

Permalink
Trying to use "event-loop" first to take an advantage of `process.nex…
Browse files Browse the repository at this point in the history
…tTick` which is much more efficient then `setTimeout`.
  • Loading branch information
Gozala committed Oct 29, 2010
1 parent 4f98b4c commit ede4c4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/q.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

// this provides an enqueue method in browsers, Narwhal, and NodeJS
var enqueue;
if (typeof setTimeout === "function") {
try {
enqueue = require("event-loop").enqueue;
} catch(e) {
enqueue = function (task) {
setTimeout(task, 0);
};
} else {
enqueue = require("event-loop").enqueue;
}

var print;
Expand Down

0 comments on commit ede4c4a

Please sign in to comment.