mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-16 18:15:42 +02:00
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:
@@ -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");
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user