How long does the train ride from Madrid to Barcelona?

About 5 hours by train, according to this website: http://gospain.about.com/od/bustravelinspain/a/madrid_bustrain.htm