There is documentation about how to optimize timing in PsychoPy® at Timing Issues and synchronisation
We recently ran a study testing the timing on a wide range of software packages, online and offline. The data for that study are available below: