diff --git a/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp b/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp index c4bb76a02d47e6180c217d27f94d6cb78d743ef0..18d5801bc96cf3eb841b219fb3dedf7e951fbdb3 100644 --- a/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp +++ b/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp @@ -51,9 +51,9 @@ void LocalHardwareManager::Init() std::lock_guard lock(localHardwareMgrMutex_); std::vector allCompTypes; ComponentLoader::GetInstance().GetAllCompTypes(allCompTypes); - uint64_t allQueryStartTime = GetCurrentTime(); + int64_t allQueryStartTime = GetCurrentTime(); for (auto dhType : allCompTypes) { - uint64_t singleQueryStartTime = GetCurrentTime(); + int64_t singleQueryStartTime = GetCurrentTime(); IHardwareHandler *hardwareHandler = nullptr; int32_t status = ComponentLoader::GetInstance().GetHardwareHandler(dhType, hardwareHandler); if (status != DH_FWK_SUCCESS || hardwareHandler == nullptr) { @@ -78,11 +78,11 @@ void LocalHardwareManager::Init() pluginListenerMap_[dhType] = listener; hardwareHandler->RegisterPluginListener(listener); } - uint64_t singleQueryEndTime = GetCurrentTime(); + int64_t singleQueryEndTime = GetCurrentTime(); DHLOGI("query %{public}#X hardware cost time: %{public}" PRIu64 " ms", dhType, singleQueryEndTime - singleQueryStartTime); } - uint64_t allQueryEndTime = GetCurrentTime(); + int64_t allQueryEndTime = GetCurrentTime(); DHLOGI("query all local hardware cost time: %{public}" PRIu64 " ms", allQueryEndTime - allQueryStartTime); std::vector> capabilityInfos; std::vector> metaCapInfos; diff --git a/utils/include/dh_utils_tool.h b/utils/include/dh_utils_tool.h index 503661378258629206f00602d7e104c3cac74313..7c7f28523c40a284f5d9d556f3832e94899f9dac 100644 --- a/utils/include/dh_utils_tool.h +++ b/utils/include/dh_utils_tool.h @@ -27,7 +27,7 @@ namespace DistributedHardware { /** * return current time in millisecond. */ -uint64_t GetCurrentTime(); +int64_t GetCurrentTime(); /** * return a random string id. diff --git a/utils/src/dh_utils_tool.cpp b/utils/src/dh_utils_tool.cpp index fb0d9bfea27b4af986951e15a430fda79651464f..b13ba10214508309f24d21e295a03641e2c85db8 100644 --- a/utils/src/dh_utils_tool.cpp +++ b/utils/src/dh_utils_tool.cpp @@ -55,7 +55,7 @@ namespace { constexpr const char *PARAM_KEY_OS_TYPE = "OS_TYPE"; } -uint64_t GetCurrentTime() +int64_t GetCurrentTime() { struct timeval tv { 0