What the optimum duration to use swipe in order to result in the position we need?

Hi,
I need to swipe up in a list view inside a scroll view from (startX ,startY) to (endX,endY).

driver.swipe(0, 1361 , 0, 560, 1700);

But the the resultant position varies on the duration…

Say I give 1000, it results in position (A,B), for 1500 it results in position (C,D).
Also for different starting pointS, it behaves differently.

Is there a optimum duration or formula to find the optimum duration so that I can achieve the resultant position?

Please help…

I am using Appium JAVA Android