maddevsio / mad-location-manager

Mad Location Manager is a library for GPS and Accelerometer data "fusion" with Kalman filter
MIT License
533 stars 154 forks source link

using elapsedRealtimeNanos instead of elapsedRealtime #80

Closed ftabashir closed 3 years ago

ftabashir commented 4 years ago

In KalmanLocationService.onSensorChanged current milliseconds is calculated like this:

long now = android.os.SystemClock.elapsedRealtimeNanos();
long nowMs = Utils.nano2milli(now);

Instead of elapsedRealtimeNanos and converting it to milliseconds you can directly use SystemClock.elapsedRealtime. I wonder if using long nowMs = SystemClock.elapsedRealtime() had any issue which you avoid?

Lezh1k commented 4 years ago

No. I guess I didn't know about elapsedRealtime.