diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a514ff..597071b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ cmake_minimum_required(VERSION 3.24.3) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +## C++ Compiler Flags. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + ## Project Name and Software Version Number project(RoveComm_CPP VERSION 3.00.00) diff --git a/src/interfaces/AutonomyThread.hpp b/src/interfaces/AutonomyThread.hpp index a4211aa..fd9a3d7 100644 --- a/src/interfaces/AutonomyThread.hpp +++ b/src/interfaces/AutonomyThread.hpp @@ -601,7 +601,7 @@ class AutonomyThread void RunThread(std::atomic_bool& bStopThread) { // Declare instance variables. - std::chrono::system_clock::time_point tmStartTime; + std::chrono::high_resolution_clock::time_point tmStartTime; // Loop until stop flag is set. while (!bStopThread) @@ -620,7 +620,7 @@ class AutonomyThread if (m_nMainThreadMaxIterationPerSecond > 0) { // Get end execution time. - std::chrono::system_clock::time_point tmEndTime = std::chrono::high_resolution_clock::now(); + std::chrono::high_resolution_clock::time_point tmEndTime = std::chrono::high_resolution_clock::now(); // Get execution time of user code. std::chrono::microseconds tmElapsedTime = std::chrono::duration_cast(tmEndTime - tmStartTime); // Check if the elapsed time is slower than the max iterations per seconds.