Verified Commit 0213179c authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test: fix duplicate namings

Ideally, we should merge the two timers
parent a8785716
Pipeline #13789 passed with stage
in 93 minutes and 5 seconds
...@@ -99,7 +99,7 @@ double distance (const std::vector<Transform3f>& tf, ...@@ -99,7 +99,7 @@ double distance (const std::vector<Transform3f>& tf,
node.enable_statistics = verbose; node.enable_statistics = verbose;
Timer timer; BenchTimer timer;
timer.start(); timer.start();
for (std::size_t i = 0; i < tf.size(); ++i) { for (std::size_t i = 0; i < tf.size(); ++i) {
...@@ -125,7 +125,7 @@ double collide (const std::vector<Transform3f>& tf, ...@@ -125,7 +125,7 @@ double collide (const std::vector<Transform3f>& tf,
node.enable_statistics = verbose; node.enable_statistics = verbose;
Timer timer; BenchTimer timer;
timer.start(); timer.start();
for (std::size_t i = 0; i < tf.size(); ++i) { for (std::size_t i = 0; i < tf.size(); ++i) {
......
...@@ -96,7 +96,7 @@ void collide(const std::vector<Transform3f>& tf, ...@@ -96,7 +96,7 @@ void collide(const std::vector<Transform3f>& tf,
Results& results) Results& results)
{ {
Transform3f Id; Transform3f Id;
Timer timer; BenchTimer timer;
for (std::size_t i = 0; i < tf.size(); ++i) { for (std::size_t i = 0; i < tf.size(); ++i) {
timer.start(); timer.start();
/* int num_contact = */ /* int num_contact = */
......
...@@ -11,7 +11,7 @@ namespace hpp ...@@ -11,7 +11,7 @@ namespace hpp
namespace fcl namespace fcl
{ {
Timer::Timer() BenchTimer::BenchTimer()
{ {
#ifdef _WIN32 #ifdef _WIN32
QueryPerformanceFrequency(&frequency); QueryPerformanceFrequency(&frequency);
...@@ -28,12 +28,12 @@ Timer::Timer() ...@@ -28,12 +28,12 @@ Timer::Timer()
} }
Timer::~Timer() BenchTimer::~BenchTimer()
{ {
} }
void Timer::start() void BenchTimer::start()
{ {
stopped = 0; // reset stop flag stopped = 0; // reset stop flag
#ifdef _WIN32 #ifdef _WIN32
...@@ -44,7 +44,7 @@ void Timer::start() ...@@ -44,7 +44,7 @@ void Timer::start()
} }
void Timer::stop() void BenchTimer::stop()
{ {
stopped = 1; // set timer stopped flag stopped = 1; // set timer stopped flag
...@@ -56,7 +56,7 @@ void Timer::stop() ...@@ -56,7 +56,7 @@ void Timer::stop()
} }
double Timer::getElapsedTimeInMicroSec() double BenchTimer::getElapsedTimeInMicroSec()
{ {
#ifdef _WIN32 #ifdef _WIN32
if(!stopped) if(!stopped)
...@@ -76,19 +76,19 @@ double Timer::getElapsedTimeInMicroSec() ...@@ -76,19 +76,19 @@ double Timer::getElapsedTimeInMicroSec()
} }
double Timer::getElapsedTimeInMilliSec() double BenchTimer::getElapsedTimeInMilliSec()
{ {
return this->getElapsedTimeInMicroSec() * 0.001; return this->getElapsedTimeInMicroSec() * 0.001;
} }
double Timer::getElapsedTimeInSec() double BenchTimer::getElapsedTimeInSec()
{ {
return this->getElapsedTimeInMicroSec() * 0.000001; return this->getElapsedTimeInMicroSec() * 0.000001;
} }
double Timer::getElapsedTime() double BenchTimer::getElapsedTime()
{ {
return this->getElapsedTimeInMilliSec(); return this->getElapsedTimeInMilliSec();
} }
......
...@@ -70,11 +70,11 @@ namespace fcl ...@@ -70,11 +70,11 @@ namespace fcl
typedef shared_ptr<octomap::OcTree> OcTreePtr_t; typedef shared_ptr<octomap::OcTree> OcTreePtr_t;
#endif #endif
class Timer class BenchTimer
{ {
public: public:
Timer(); BenchTimer();
~Timer(); ~BenchTimer();
void start(); ///< start timer void start(); ///< start timer
void stop(); ///< stop the timer void stop(); ///< stop the timer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment