Skip to content

Header-only file allowing timing runtime assessments for C++

Notifications You must be signed in to change notification settings

PaowZ/LibTimedMarker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibTimedMarker

Header-only file allowing timing runtime assessments for C++.

Use:

START_TIMER(): Start a time-measured block. may be TM::nano, TM::micro, TM::milli, TM::sec, TM::min
LAP(): Display intermediate timings. is the displayed message.
END_TIMER(): Display last timer and total. is the displayed message.

Example:

int main() {

START_TIMER(TM::milli)
std::cout << "Hello World!"
          << std::endl;

for(int i=0,j=0;i<100000000;++i)
    j++;

LAP("intermediate")

for(int i=0,j=0;i<100000000;++i)
    j++;

END_TIMER("Time exec")
return 0;

}

Output:

Hello World!
» intermediate: 174.81 ms
» Time exec: 171.69 ms


» Total: 346.59 ms

Requirements

  • C++17

TBD

  • Change standard output for variable outputs.

About

Header-only file allowing timing runtime assessments for C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published