Versatile second-harmonic interferometer with high temporal resolution and high sensitivity based on a continuous-wave Nd : YAG laser