mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Add a sleep function (useful for introducing latency in manual debugging).
This commit is contained in:
@@ -141,4 +141,15 @@ _.extend(Meteor._SynchronousQueue.prototype, {
|
||||
}
|
||||
});
|
||||
|
||||
// Sleep. Mostly used for debugging (eg, inserting latency into server
|
||||
// methods).
|
||||
Meteor._sleepForMs = function (ms) {
|
||||
var fiber = Fiber.current;
|
||||
setTimeout(function() {
|
||||
fiber.run();
|
||||
}, ms);
|
||||
Fiber.yield();
|
||||
};
|
||||
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user