What is the delay in traseferring data between arduino and pc?

Hello everyone :),

I want your help. I have an issue and i want to take some informations before ? buy an arduino. I want to know how is the delay(latency ), if exists, in trasnfering data from arduino to pc. Which are the factors that determine the delay. I want to know because the accuracy is vey important for my issue.

Thank you all for your time

It depends on many factors, some of which may not be under your control.
The most obvious factor is bit rate, which is up to you to decide.

How can i define the bit rate, with code?
The other factors that are not under my control, they have to do with hardware like sensors or the same arduino ?
If yes, these factors are most important for me. If i can not do anything then i need to know how is exactly the latency from these factors!
Is it possible?

How can i define the bit rate, with code?

I think the big unknown is on the PC side: once the data has been received (by the serial or USB port , how long does it take to get into the application program which processes the data on the PC? Since there are many processes running on the PC at the same time, the operating system needs some time to pick up the data and wake up the application program. I think you need to run the time critical part of your application entirely on the Arduino, where you have full control over time.

I think the biggest factors are: The OS you are running on the PC; the hardware of the PC and the software that runs on the PC.
In other words with a Big machine only connected to the USB (no network/ no mouse / no keyboard / ....) with a Real time OS and only the communication software running (no music playing/...) you will have the smallest delay.
Change any of those and the delay will go up.
I'm running windows (which is a bad real time OS), I can't complain about the hardware and I run wait to much software (virus scanners, firewalls ....) but I never had a delay on the serial communication that stroked me as to long.

privatier:
I think you need to run the time critical part of your application entirely on the Arduino, where you have full control over time.

But then again I always use the same principle as proposed by privatier.

The most time critical communication I had between PC and Arduino was A 3D laser scanner. There the PC send a signal to Arduino who controls a laserline and the PC captures video. As the laser-line position on the camera is at the basis of triangular calculations there is time constraint.
However the actual delay is less important than the repetitive. (For more details on this see this forum post http://www.david-laserscanner.com/forum/viewtopic.php?f=6&t=1216&hilit=arduino )

I hope this helps.
Greetings from the sun in Belgium
Jantje