As of 2009 when this question was written, the all-time record for weeks at World No.1 was held by Pete Sampras (286 weeks). Federer had surpassed this by 2012 and ultimately reached 310 weeks. At the time of this question, Federer did not yet hold the record.