Plato on Github
Report Home
node_modules/when/lib/timer.js
Maintainability
76.50
Lines of code
23
Difficulty
15.54
Estimated Errors
0.16
Function weight
By Complexity
By SLOC
/** @license MIT License (c) copyright 2010-2014 original author or authors */ /** @author Brian Cavalier */ /** @author John Hann */ (function(define) { 'use strict'; define(function(require) { /*global setTimeout,clearTimeout*/ var cjsRequire, vertx, setTimer, clearTimer; cjsRequire = require; try { vertx = cjsRequire('vertx'); setTimer = function (f, ms) { return vertx.setTimer(ms, f); }; clearTimer = vertx.cancelTimer; } catch (e) { setTimer = function(f, ms) { return setTimeout(f, ms); }; clearTimer = function(t) { return clearTimeout(t); }; } return { set: setTimer, clear: clearTimer }; }); }(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(require); }));