The electron time-of-fhght distance I between the acceleration site and the chromosphere can be measured during solar flares from energy-dependent hard X-ray (HXR) time delays tau(epsilon), based on the applicability of the thick-target model. The determination of the path length I represents an inversion problem because the time-dependent electron injection spectrum at the acceleration site, N(E, t, x = 0), is retarded by the propagation time t(prop)(E) = l/v(E) at the thick-target site, i.e., N(E, t, x = l) = N[E, t - t(prop)(E), x = 0], and has to be convolved with the bremsstrahlung cross section sigma(epsilon, E) and the instrumental detector response function R(i)(epsilon) to reproduce the observed HXR time profiles I(epsilon(i), t) (indifferent detector channels i), from which the time delay differences tau(epsilon(i)) - tau(epsilon(j)) can be measured. In this study, we solve this inversion problem by numerical forward integration of time-dependent electron injection spectra N(E, t) with Gaussian pulse shapes to obtain the convolved time-dependent HXR spectra I(epsilon, t), using specific detector response functions from the Burst and Transient Source Experiment/Compton Gamma Ray Observatory and the Hard X-Ray Burst Spectrometer/Solar Maximum Mission. We find that the timing of HXR pulses can be accurately represented with the (monoenergetic) photon energy epsilon(i) that corresponds to the median of the channel count spectra C-i(epsilon) = I(epsilon)R(i)(epsilon). We compute numerical conversion factors q(E)(epsilon, gamma, E(0)) that permit the conversion of the timing of photon energies epsilon(i)(t) (for a power-law spectrum with slope gamma and upper cutoff energy E,) into electron energies E(i)(t)= q(E) epsilon(t), from which kinematic parameters can be fitted to determine the electron time-of-flight path length E. We test the inversion procedure with numeric simulations and demonstrate that the inversion is accurate within sigma(i)/l less than or similar to 1% for noise-free data. This inversion procedure is applied to the Masuda flare (in this volume) to localize the electron acceleration region.