Absolute measurement of accelerator beam energy by the time-of-flight technique