Time-of-flight (ToF) systems which use pulsed laser diodes, are required to measure distances with high level of precision and control. The present disclosure provides a method and a corresponding system for controlling a temporal response of a laser diode, in particular pulsed laser diodes. In particular, the present disclosure provides a method and a related system for driving a laser diode so as to obtain predominantly a peak pulse response while minimising or completely avoiding the post-peak response in a temporal response of the laser diode.