Skip to content
/ counter Public

Count ( make statistics of ) used operators/functions. Exact number of use will give you exact time consumption.

License

Notifications You must be signed in to change notification settings

dmilos/counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Count every usage of arithmetic/mathematic functions

  • Status:
  • Ready for test use.

Key features:

  • Headers only
  • No third parties
  • No additional binaries
  • One file to include to start the fun
  • Easy to integrate
  • Easy to disintegrate
  • Out of the box ready
  • No need to recompile or start some install process.

Example:

#include <iostream>
#include <iomanip>

#include "counter/counter.hpp"

typedef ::counter::number<double> MyDouble;

int main( int argc, char *argv[] )
 {
  
  MyDouble a, b, c;

  a = a + b + - c;

  std::cout << "Number of calls of assignment operator: " 
            << MyDouble::statistics()[ ::counter::constant::operator_assign ]
            << std::endl
            << "Number of calls of binary plus operator: " 
            << MyDouble::statistics()[ ::counter::constant::operator_plus_binary ]
            << std::endl
            << "Number of calls of unary minus: " 
            << MyDouble::statistics()[ ::counter::constant::operator_minus_unary ]
            << std::endl;

  return EXIT_SUCCESS;
 }

Want to see more:

About

Count ( make statistics of ) used operators/functions. Exact number of use will give you exact time consumption.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published