timeit.js
// If the call stack grows too deep, use callbacks.
If the call stack grows too deep, use callbacks.
If the call stack grows too deep use callbacks .
function repeatWhile( test, visitor, callback ) {
    if (test()) {
        visitor(function(err){
            if (err) return callback(err);
            else repeatWhile(test, visitor, callback);
        });
    }
    else return callback();
}
function repeatWhile ( test , visitor , callback ) { if ( test ( ) ) { visitor ( function ( err ) { if ( err ) return callback ( err ) ; else repeatWhile ( test , visitor , callback ) ; } ) ; } else return callback ( ) ; }
If the call stack grows too deep, use callbacks.
If the call stack grows too deep use callbacks .
// self-recurse to work with both sync and async tests