Direct measurement of the recovery time of superconducting nanowire single-photon detectors