How long did the Mughal empire last in India?

The Mughal empire was founded by Babur in 1526 and was dissolved by the British in 1857, a span of 331 years.