lib/timeout.js
function(callback, timeout){
        var id = index++;
        if(timeout > MAX_INT){
            timeouts[id] = setTimeout(set.bind(undefined, callback, timeout - MAX_INT), MAX_INT);
        }else{
            if(timeout < 0) timeout = 0;
            timeouts[id] = setTimeout(function(){
                delete timeouts[id];
                callback();
            }, timeout);
        }
        return id;
    }
function(callback, timeout){
        var id = index++;
        if(timeout > MAX_INT){
            timeouts[id] = setTimeout(set.bind(undefined, callback, timeout - MAX_INT), MAX_INT);
        }else{
            if(timeout < 0) timeout = 0;
            timeouts[id] = setTimeout(function(){
                delete timeouts[id];
                callback();
            }, timeout);
        }
        return id;
    }
function ( callback , timeout ) { var id = index ++ ; if ( timeout > MAX_INT ) { timeouts [ id ] = setTimeout ( set . bind ( undefined , callback , timeout - MAX_INT ) , MAX_INT ) ; } else { if ( timeout < 0 ) timeout = 0 ; timeouts [ id ] = setTimeout ( function ( ) { delete timeouts [ id ] ; callback ( ) ; } , timeout ) ; } return id ; }
Set new timeout
Set new timeout