Comparison of Superconducting Nanowire Single-Photon Detectors Made of NbTiN and NbN Thin Films