First cut of Timer class.

- started integrating with reporters (now (optionally) supported in console reporter).
- introduced Node<> template to help with cumulative reporting and used it instead of ThreadedSectionInfo.
This commit is contained in:
Phil Nash
2013-08-07 18:56:35 +01:00
parent 649f8c24b1
commit 6339254cb2
16 changed files with 379 additions and 174 deletions

View File

@@ -341,3 +341,26 @@ TEST_CASE("./failing/CatchSectionInfiniteLoop", "")
FAIL("to infinity and beyond");
}
#include "internal/catch_timer.h"
TEST_CASE( "Timer", "[work-in-progress]" )
{
Catch::Timer t;
t.start();
std::cout << "starting..." << std::endl;
double d = 0;
for( int i = 0; i < 100000; ++i )
for( int j = 0; j < 1000; ++j )
d += (double)i*(double)j;
double duration = t.getElapsedSeconds();
std::cout << "finished in " << duration << std::endl;
SUCCEED("yay");
}