Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
scoped_timer Class Reference

Public Member Functions

 scoped_timer (std::string i)
 
 ~scoped_timer ()
 

Detailed Description

Definition at line 32 of file parser_perf.cpp.

Constructor & Destructor Documentation

◆ scoped_timer()

scoped_timer::scoped_timer ( std::string i)
inline

Definition at line 34 of file parser_perf.cpp.

34 : m_id(i),m_start(std::chrono::steady_clock::now()) {
35 std::cout << "Clock " << i << ": ";
36 }

◆ ~scoped_timer()

scoped_timer::~scoped_timer ( )
inline

Definition at line 37 of file parser_perf.cpp.

37 {
38 std::chrono::nanoseconds time_taken = std::chrono::steady_clock::now()-m_start;
39
40 //nanoseconds_per_test
41
42 //tests_per_second
43
44 //1000000000.0/(double(time_taken.count())/1000.0)
45
46 std::cout << 1000000000.0/(double(time_taken.count())/1000.0) << std::endl;
47
48 //std::cout << (1.0/double(time_taken.count())) * double(1000000000*1000) << std::endl;
49 }

The documentation for this class was generated from the following file: