Edit in JSFiddle

// jQuery's animate function is closely tied to CSS properties, at the moment.
// But by using a fake CSS property, you can provide a custom setting function
// using step.

// This example shows animating the text in a paragraph using a fake css property.

(function($) {
    
    $(function() {
        
        var $select = $( 'select' );
        
        for ( func in $.easing ) {
            if ( func !== 'def' ) {
                $( '<option />', {
                    text: func,
                    val: func
                }).appendTo( $select );
            }
        }
        
            
        $( 'button' ).bind( 'click', function() {
    
            var $p = $( 'p' ).first(),
                text = $p.text(),
                length = text.length,
                ease = $( this ).text(),
                $speed = $( 'input[type="number"]' );
    
            $p 
                .stop()
                .css({ 'fake-property': 0 })
                .animate({
                    // Animate the fake property from 0 to the length of the text
                    'fake-property': length 
                }, {
                    // Make the speed directly proportional to the length of the text
                    duration: $speed.val() * length,
                    easing: $select.val(),
                    step: function( i ) {
                        var i = Math.round( i );
                        
                        $p.html( text.substr( 0, i ) + '<span class="invisible">' + text.substring( i )  + '</span>' );
                    }
                });
    
        });
        
    });

})( jQuery );
<h1>Arbitrary Animation</h1>

<select></select> <button>Animate</button>

<p>Look, just because I don't be givin' no man a foot massage don't make it right for Marsellus to throw Antwone into a glass motherfuckin' house, fuckin' up the way the #$@#$! talks. Motherfucker do that shit to me, he better paralyze my ass, 'cause I'll kill the motherfucker, know what I'm sayin'?  Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends.</p>

<p>Speed: <input type="number" value="10" min="1" max="1000" /> (lower is faster)</p>

<p>(Placeholder text courtesy of <a href="http://slipsum.com">Samuel L. Ipsum</a>)</p>
h1 {
    font-size: 24px;
    margin: 0 0 1em;
}

h2 {
    font-size: 18px;
    margin: 1em 0;
}

body {
    background-color: #333;
    color: #fff;
    font-family: Helvetica;
    margin: 0;
    padding: 50px;
}

p {
    margin: 1em 0;
}

p:first-of-type {
    background-color: #222;
    border: 10px solid #555;
    border-radius: 10px;
    box-shadow: 0 0 1em #000;
    padding: 20px;
    position: relative;
    width: 400px;
}

p:first-of-type:before {
    border: 2px solid #222;
    border-radius: 5px;
    bottom: -2px;
    content: '';
    display: block;
    left: -2px;
    position: absolute;
    right: -2px;
    top: -2px;
}

.invisible {
    opacity: 0;
}

a {
    color: #999;
}