Ver Fonte

Replaced boost::timer with std::chrono

mensinda há 9 anos atrás
pai
commit
cc0fce8568

+ 0 - 1
code/FBXImporter.cpp

@@ -46,7 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <exception>
 #include <iterator>
-#include <boost/tuple/tuple.hpp>
 
 #include "FBXImporter.h"
 

+ 5 - 4
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 <chrono>
 #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<double> elapsedSeconds = std::chrono::system_clock::now() - regions[region];
+        DefaultLogger::get()->debug((format("END   `"),region,"`, dt= ", elapsedSeconds.count()," s"));
     }
 
 private:
 
-    typedef std::map<std::string,boost::timer> RegionMap;
+    typedef std::map<std::string,std::chrono::time_point<std::chrono::system_clock>> RegionMap;
     RegionMap regions;
 };
 

+ 2 - 1
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 <tuple>
 
 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));
 }
 
 // ------------------------------------------------------------------------------------------------

+ 1 - 0
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 <tuple>
+#include <vector>
 
 namespace AssimpView
 {