function speedTestExe(fn, args, count, context, undefined){

    var i = -1,
        start = Date.now(),
        errors = [],
        elapsed;

    if (fn == undefined){
        return 'Test function is undefined.';
    }

    function timing(time){
        var out = {};
        out.num = out.ms = (Date.now() - time);
        out.milliseconds = out.ms+'ms';
        out.sec = (out.ms/1000);
        out.seconds = (out.sec + 's');
        return out;
    }

    count   = count   || 1000;
    context = context || null;

    // collect any results
    while(++i < count){
        try {
            fn.apply(context, [].concat(args||[]));
        }
        catch(e){
            errors.push(e);
            break;
        }
    }

    elapsed = timing(start);
    elapsed.errors = errors;

    console.log(elapsed.seconds);

    return elapsed;

}
// same as speedTest() above but doesn't collect results
same as speedTest() above but doesn't collect results
same as speedTest () above but doesn ' t collect results
function speedTestExe(fn, args, count, context, undefined){
    var i = -1,
        start = Date.now(),
        errors = [],
        elapsed;
    if (fn == undefined){
        return 'Test function is undefined.';
    }
    function timing(time){
        var out = {};
        out.num = out.ms = (Date.now() - time);
        out.milliseconds = out.ms+'ms';
        out.sec = (out.ms/1000);
        out.seconds = (out.sec + 's');
        return out;
    }
    count   = count   || 1000;
    context = context || null;
    while(++i < count){
        try {
            fn.apply(context, [].concat(args||[]));
        }
        catch(e){
            errors.push(e);
            break;
        }
    }
    elapsed = timing(start);
    elapsed.errors = errors;
    console.log(elapsed.seconds);
    return elapsed;
}
function speedTestExe ( fn , args , count , context , undefined ) { var i = - 1 , start = Date . now ( ) , errors = [ ] , elapsed ; if ( fn == undefined ) { return 'Test function is undefined.' ; } function timing ( time ) { var out = { } ; out . num = out . ms = ( Date . now ( ) - time ) ; out . milliseconds = out . ms + 'ms' ; out . sec = ( out . ms / 1000 ) ; out . seconds = ( out . sec + 's' ) ; return out ; } count = count || 1000 ; context = context || null ; while ( ++ i < count ) { try { fn . apply ( context , [ ] . concat ( args || [ ] ) ) ; } catch ( e ) { errors . push ( e ) ; break ; } } elapsed = timing ( start ) ; elapsed . errors = errors ; console . log ( elapsed . seconds ) ; return elapsed ; }
same as speedTest() above but doesn't collect results
same as speedTest () above but doesn ' t collect results
// collect any results