Time-resolved study of the switching of multiferroic BiFeO3