#include <iostream>
#include <string>
#include <memory>
#include <chrono>
#include <vector>
using namespace std;

#define ITER 100000

class Print{

public:

virtual void print(int p1, float p2, float p3, float p4){/*print */}

};

class PrintWrapper
{

    public:

      PrintWrapper(shared_ptr<Print> print, int p1, float p2, float p3, float p4) :
      m_print(print), _p1(p1),_p2(p2),_p3(p3),_p4(p4){}

      ~PrintWrapper(){}

      void execute()
      { 
        m_print->print(_p1,_p2,_p3,_p4); 
      }

    private:

      shared_ptr<Print> m_print;
      int _p1;
      float _p2,_p3,_p4;

};

void test()
{
 shared_ptr<Print> p(new Print());
 shared_ptr<PrintWrapper> pw(new PrintWrapper(p, 1, 2.f,3.0f,4.0f));

 //-------------test 1-------------------------
 auto time1 = std::chrono::system_clock::now();

 for (auto var = 0; var < ITER; ++var) 
 {
   p->print(1, 2.f,3.0f,4.0f);
 }

 auto time2 = std::chrono::system_clock::now();

 cout <<"test 1 : "<< (time2 - time1).count() << " microseconds." << endl;
 
  //-------------test 2-------------------------
 auto time3 = std::chrono::system_clock::now();

 for (auto var = 0; var < ITER; ++var) 
 {
   pw->execute();
 }

 auto time4 = std::chrono::system_clock::now();

 cout <<"test 2 : "<< (time4 - time3).count() << " microseconds." << endl;

}
int main() { test(); }