pzibang / Timer

A simple but powerful C++ code performance measurement library which just contains a single header file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Timer

A simple but powerful C++ code performance measurement library which is contained in two header files.

Simple example within the timer.h file

inline void* timer_malloc(size_t size) {
  TIMER_FLOPS("timer_malloc");
  timer.flops += size;
  void* p = malloc(size);
  memset(p, 0, size);
  return p;
}

inline void timer_free(void* ptr) {
  TIMER("timer_free");
  free(ptr);
}

inline void tmalloc(size_t size)
{
  timer_malloc(size);
}

inline void tfree(void* ptr)
{
  timer_free(ptr);
}

To show the summary

Timer::display()

About

A simple but powerful C++ code performance measurement library which just contains a single header file.

License:GNU General Public License v3.0


Languages

Language:C++ 100.0%