Time-domain terahertz science improves relativistic electron-beam diagnostics