diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 9551e266a05..28a622d27e7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include diff --git a/ReactCommon/fabric/mounting/MountingCoordinator.cpp b/ReactCommon/fabric/mounting/MountingCoordinator.cpp index d0bf0dc2fb0..9d36097c60b 100644 --- a/ReactCommon/fabric/mounting/MountingCoordinator.cpp +++ b/ReactCommon/fabric/mounting/MountingCoordinator.cpp @@ -16,7 +16,6 @@ #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/utils/TimeUtils.h b/ReactCommon/utils/TimeUtils.h deleted file mode 100644 index e4a6c3ec510..00000000000 --- a/ReactCommon/utils/TimeUtils.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) - -// It's Unix -#include -#include - -#endif - -#if defined(__APPLE__) && defined(__MACH__) - -// It's iOS or macOS or one of derivatives. -#include -#include -#include - -#endif - -namespace facebook { -namespace react { - -inline static int64_t monotonicTimeInMilliseconds() { -#if defined(__APPLE__) && defined(__MACH__) - - static struct mach_timebase_info tb_info = {0}; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - __unused int ret = mach_timebase_info(&tb_info); - assert(0 == ret); - }); - - return (mach_absolute_time() * tb_info.numer) / tb_info.denom / 1000000; - -#elif defined(_POSIX_MONOTONIC_CLOCK) - - // It's Unix with MONOTONIC_CLOCK support (e.g. Android) - - constexpr static int64_t NANOSECONDS_IN_SECOND = 1000000000LL; - constexpr static int64_t NANOSECONDS_IN_MILLISECOND = 1000000LL; - - // Since SystemClock.uptimeMillis() is commonly used for performance - // measurement in Java and uptimeMillis() internally uses - // clock_gettime(CLOCK_MONOTONIC), we use the same API here. We need that to - // make sure we use the same time system on both JS and Java sides. Links to - // the source code: - // https://android.googlesource.com/platform/frameworks/native/+/jb-mr1-release/libs/utils/SystemClock.cpp - // https://android.googlesource.com/platform/system/core/+/master/libutils/Timers.cpp - struct timespec now; - - clock_gettime(CLOCK_MONOTONIC, &now); - - return (now.tv_sec * NANOSECONDS_IN_SECOND + now.tv_nsec) / - NANOSECONDS_IN_MILLISECOND; - -#else - - // It's Unix *without* MONOTONIC_CLOCK support or Microsoft Windows. - // If you run this on Microsoft Windows, could you please implement the - // function using some Windows-specific APIs, and submit a PR? - // https://stackoverflow.com/questions/5404277/porting-clock-gettime-to-windows - -#endif -} - -} // namespace react -} // namespace facebook