The resistance induced by nanosecond pulses of electric currrent or of light has been studied in superconducting Nb and NbN thin films. Narrow bridges exhibit the features expected from quasi-1D transport, namely, localized phase-slip centers (PSC) and hot spots (HS), depending upon the prescribed conditions of temperature and applied current. PSC and HS are clearly identified from their characteristic delay and their evolution in time. We then analyze the response to combined pulsed illumination and current. Using very thin (4 nm) niobium-nitride films, it was possible to detect the visible light delivered photon by photon.