Accuracy of psychopy keystroke duration measurement

No. Unless you are doing that between collecting keypresses, which you should not. Store data in arrays during an experiment, after the experiment dump the data from arrays to files.

best,

Allen