Replaced boost::timer with std::chrono

pull/850/head
mensinda 2016-04-06 10:13:02 +02:00
parent ae99f99b99
commit cc0fce8568
4 changed files with 8 additions and 6 deletions

View File

@ -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"

View File

@ -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;
};

View File

@ -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));
}
// ------------------------------------------------------------------------------------------------

View File

@ -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
{