1. A method of learning using a spiking neural network, comprising: (a) delaying an input spike in an artificial neuron according to a current delay associated with an input to the artificial neuron, wherein the input spike occurs at an input spike time relative to a reference time for the artificial neuron; (b) emitting an output spike from the artificial neuron based, at least in part, on the delayed input spike; (c) determining an actual time difference between the emission of the output spike from the artificial neuron and the reference time for the artificial neuron; and (d) adjusting the current delay associated with the input based on a difference between a target time difference and the actual time difference, the current delay, and an input spike time for the input spike.