Hi @Luc001,
I have some previous advice in these two posts which is likely a decent starting point - there’s probably a delay in your code (either explicitly in a sleep/wait, or just while it’s doing other things) that’s causing the extra latency.
If those examples don’t help we can potentially take a look at the actual code you’re running, assuming that’s something you’re able and willing to share.