https://github.com/HeisSpiter/acprof
Revision 5e6f3012828c3705c075ff75bd5ed7cc49a7869e authored by Pierre Schweitzer on 05 June 2013, 13:21:11 UTC, committed by Pierre Schweitzer on 05 June 2013, 13:21:11 UTC
1 parent b269f58
Raw File
Tip revision: 5e6f3012828c3705c075ff75bd5ed7cc49a7869e authored by Pierre Schweitzer on 05 June 2013, 13:21:11 UTC
Add support for profiling on which CPU core the code ended running
Tip revision: 5e6f301
main.cpp
#include "functions.hpp"
#include "classes.hpp"

int main(int argc, char **argv) {
   Maths math;
   unsigned int max;

   for (int i = 0; i < argc; ++i) {
      std::cout << "Arg " << i << ": " << argv[i] << std::endl;
   }

   max = AskMax("You want number of primes lower than? ");
   std::cout << "Result: " << FrequencyOfPrimes(max) << std::endl;

   max = AskMax("You want max resolution for Pi of? ");
   std::cout << "Result: " << Madhava(max) << std::endl;

   max = AskMax("You want factorial of? ");
   std::cout << "Result: " << Factorial(max) << std::endl;

   std::cout << "Current max: " << math.GetMax() << std::endl;

   max = AskMax("You want sum of max? " );
   math.SetMax(max);
   std::cout << "Result: " << math.GetSum() << std::endl;

   max = AskMax("You want number of primes lower than? ");
   math.SetMax(max);
   std::cout << "Result: " << math.GetFrequencyOfPrimes() << std::endl;

   return 0;
}
back to top