From cc0fce8568c29d6ddb75c367c62bf60ceeae72a4 Mon Sep 17 00:00:00 2001 From: mensinda Date: Wed, 6 Apr 2016 10:13:02 +0200 Subject: [PATCH] Replaced boost::timer with std::chrono --- code/FBXImporter.cpp | 1 - code/Profiler.h | 9 +++++---- tools/assimp_view/AnimEvaluator.cpp | 3 ++- tools/assimp_view/AnimEvaluator.h | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/FBXImporter.cpp b/code/FBXImporter.cpp index f332244d5..9d6c4c021 100644 --- a/code/FBXImporter.cpp +++ b/code/FBXImporter.cpp @@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include #include "FBXImporter.h" diff --git a/code/Profiler.h b/code/Profiler.h index c2b8b5009..a458ecffc 100644 --- a/code/Profiler.h +++ b/code/Profiler.h @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_PROFILER_H #define INCLUDED_PROFILER_H -#include "boost/timer.hpp" +#include #include "../include/assimp/DefaultLogger.hpp" #include "TinyFormatter.h" @@ -71,7 +71,7 @@ public: /** Start a named timer */ void BeginRegion(const std::string& region) { - regions[region] = boost::timer(); + regions[region] = std::chrono::system_clock::now(); DefaultLogger::get()->debug((format("START `"),region,"`")); } @@ -83,12 +83,13 @@ public: return; } - DefaultLogger::get()->debug((format("END `"),region,"`, dt= ",(*it).second.elapsed()," s")); + std::chrono::duration elapsedSeconds = std::chrono::system_clock::now() - regions[region]; + DefaultLogger::get()->debug((format("END `"),region,"`, dt= ", elapsedSeconds.count()," s")); } private: - typedef std::map RegionMap; + typedef std::map> RegionMap; RegionMap regions; }; diff --git a/tools/assimp_view/AnimEvaluator.cpp b/tools/assimp_view/AnimEvaluator.cpp index c3baee9d5..df7bacb5c 100644 --- a/tools/assimp_view/AnimEvaluator.cpp +++ b/tools/assimp_view/AnimEvaluator.cpp @@ -40,6 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "assimp_view.h" +#include using namespace AssimpView; @@ -49,7 +50,7 @@ AnimEvaluator::AnimEvaluator( const aiAnimation* pAnim) { mAnim = pAnim; mLastTime = 0.0; - mLastPositions.resize( pAnim->mNumChannels, boost::make_tuple( 0, 0, 0)); + mLastPositions.resize( pAnim->mNumChannels, std::make_tuple( 0, 0, 0)); } // ------------------------------------------------------------------------------------------------ diff --git a/tools/assimp_view/AnimEvaluator.h b/tools/assimp_view/AnimEvaluator.h index 60d5c299d..417a02935 100644 --- a/tools/assimp_view/AnimEvaluator.h +++ b/tools/assimp_view/AnimEvaluator.h @@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AV_ANIMEVALUATOR_H_INCLUDED #include +#include namespace AssimpView {