How to write a script to record the time from stimulus presentation to picture naming in PWI paradigm

How to write a script to record the timestamp at the onset of the stimulus presentation and then record another timestamp at the moment of picture naming-the voice?