It's actually not at all clear that the British colonial empire was a net positive economically. It's also not always the case that they were exploiting the people, rather than the mineral deposits etc.
It also wasn't "centuries". The British Crown ruled India (which at the time contained Pakistan and Bangladesh) for less than a century, for instance.