I have accelerometer readings that are updated from the onSensorChanged() function each time the accelerometer values change. I then create a file where I write the accelerometer readings (X,Y,Z) axis on each line but would also like to add the time intervals between each reading. I was reading somewhere that using System.currentTimeMillis() isn’t the way to go. What would be the best way of doing this as accurately as possible?
I have accelerometer readings that are updated from the onSensorChanged() function each time the
Share
I suggest to use the timestamp field of a SensorEvent:
Just remember the last value and calculate the difference that way