High resolution time-of-flight system for precise measurement of excitation energies and Q-values