In the nervous system, sensory neurons encode signals as a sequence of action potentials (spikes). However, spike generation is metabolically expensive. Achieving high coding fidelity may require a high spike rate. Here we propose that neurons achieve a trade-off by optimally timing spikes so that maximum fidelity is achieved for a given spike rate. The proposed neural encoder generates spikes which are reconstructed by a linear filter, with energy modeled as a constraint proportional to the average spike-rate. We develop expressions for the encoding error and derive the optimal parameters in the limit of high spike-firing rates. The energy-constrained neural encoder is compared with experimental spike-times from two sensory neurons, one cortical and one peripheral. The proposed energy-constrained neural encoder closely approximates the experimentally recorded spike-times, and the decoded experimental inputs are within 2dB of the predicted distortion-energy curve for both neurons.