Skip to content

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

License

Notifications You must be signed in to change notification settings

jinluchang/Timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages