Here it says
Federer has been ranked in the top two for 377 total weeks, as of Monday 28 February 2011, surpassing the previous record of Sampras of 376 weeks in top two.
without a clear source. Can anyone confirm the 377 weeks? I think it must be about correct. Sampras' 376 is correct.
As for total weeks in top 3, Sampras still has a handsome lead on Federer. According to http://www.tennis28.com/rankings/weeks_No2_No10.html
Sampras had 81 weeks at #3 and 457 weeks in the top 3, while Federer has only 26 weeks at #3 by now (http://www.tennis28.com/rankings/history/federer.html
). Federer spent only 4 weeks at #4 by the way. :P
As for consecutive top 3, Federer has been top 3 since halfway 2003 without interruption (http://www.tennis28.com/charts/Federer_rank.GIF
), some 7.5 years. Sampras has roughly the same if I read his graph correctly: http://www.tennis28.com/charts/Sampras_rank.GIF