SDL: Use nanosecond timestamp for sensors (thanks @1bsyl!)

From b6646f4de5656e948ad3ffd0e290a33c8e092595 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 23 Jan 2023 05:33:56 -0800
Subject: [PATCH] Use nanosecond timestamp for sensors (thanks @1bsyl!)

---
 src/sensor/android/SDL_androidsensor.c       | 2 +-
 src/sensor/coremotion/SDL_coremotionsensor.m | 2 +-
 src/sensor/windows/SDL_windowssensor.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c
index c1987f42ba92..093eca0eb2d2 100644
--- a/src/sensor/android/SDL_androidsensor.c
+++ b/src/sensor/android/SDL_androidsensor.c
@@ -156,7 +156,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
     int events;
     ASensorEvent event;
     struct android_poll_source *source;
-    Uint64 timestamp = SDL_GetTicks();
+    Uint64 timestamp = SDL_GetTicksNS();
 
     if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
         SDL_zero(event);
diff --git a/src/sensor/coremotion/SDL_coremotionsensor.m b/src/sensor/coremotion/SDL_coremotionsensor.m
index a753b66e95ef..6afe47c8fcf2 100644
--- a/src/sensor/coremotion/SDL_coremotionsensor.m
+++ b/src/sensor/coremotion/SDL_coremotionsensor.m
@@ -137,7 +137,7 @@ static int SDL_COREMOTION_SensorOpen(SDL_Sensor *sensor, int device_index)
 
 static void SDL_COREMOTION_SensorUpdate(SDL_Sensor *sensor)
 {
-    Uint64 timestamp = SDL_GetTicks();
+    Uint64 timestamp = SDL_GetTicksNS();
 
     switch (sensor->type) {
     case SDL_SENSOR_ACCEL:
diff --git a/src/sensor/windows/SDL_windowssensor.c b/src/sensor/windows/SDL_windowssensor.c
index 9a4d4784e76a..3d64232379fa 100644
--- a/src/sensor/windows/SDL_windowssensor.c
+++ b/src/sensor/windows/SDL_windowssensor.c
@@ -143,7 +143,7 @@ static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnStateChanged(ISensorEvents
 static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnDataUpdated(ISensorEvents *This, ISensor *pSensor, ISensorDataReport *pNewData)
 {
     int i;
-    Uint64 timestamp = SDL_GetTicks();
+    Uint64 timestamp = SDL_GetTicksNS();
 
     SDL_LockSensors();
     for (i = 0; i < SDL_num_sensors; ++i) {