Medusa  1.1
Coordinate Free Mehless Method implementation
test/utils/Timer_test.cpp
#include "gtest/gtest.h"
namespace mm {
TEST(Utils, TimerDuration) {
Timer t;
t.addCheckPoint("a");
t.addCheckPoint("b");
double diff = t.duration("a", "b");
EXPECT_GT(diff, 0);
double diff2 = t.durationToNow("a");
EXPECT_LT(diff, diff2);
EXPECT_GT(diff2, 0);
}
TEST(Utils, DISABLED_TimerUsageExample) {
Timer timer;
timer.addCheckPoint("beg");
//... code ...
timer.addCheckPoint("mid");
// ...more code ...
timer.addCheckPoint("end");
timer.showTimings("beg", "mid"); // shows time between two checkpoints
std::cout << timer << std::endl;
double t = timer.duration("beg", "end"); // time difference in seconds
std::cout << t << std::endl; // not unused
}
} // namespace mm
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
Timer.hpp