diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp index e6b2b7224c..c18de4e283 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp @@ -14,7 +14,7 @@ extern "C" { a.x = -((double)x / TG3_GRAVITY_EARTH); a.y = -((double)y / TG3_GRAVITY_EARTH); a.z = -((double)z / TG3_GRAVITY_EARTH); - a.timestamp = (double)timeStamp; + a.timestamp = (double)timeStamp / 1e9; EventAcceleration event(a); Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); diff --git a/cocos/platform/tizen/CCDevice-tizen.cpp b/cocos/platform/tizen/CCDevice-tizen.cpp index a35dd21f1d..4d2e3f969c 100644 --- a/cocos/platform/tizen/CCDevice-tizen.cpp +++ b/cocos/platform/tizen/CCDevice-tizen.cpp @@ -78,7 +78,7 @@ static void accelerometer_sensor_cb(sensor_h _sensor, sensor_event_s *sensor_dat _acceleration->x = sensor_data->values[0] / GRAVITY_EARTH; _acceleration->y = sensor_data->values[1] / GRAVITY_EARTH; _acceleration->z = sensor_data->values[2] / GRAVITY_EARTH; - _acceleration->timestamp = sensor_data->timestamp; + _acceleration->timestamp = (double)sensor_data->timestamp / 1e3; double tmp = _acceleration->x; Application *app = Application::getInstance();