#include "stdinc.h"
#include "Profile_Timer.h"

void insertion_sort(int,int*,int&);

int randint(int lo, int hi)
{
   return lo + (rand() % (hi + 1 - lo));
}

int main()
{
   int   i,
         n,
         lines,
         *A,
         *B;
   Profile_Timer timer;
   Profile_Timer::Elapsed_Time et;

   for (n = 20; n <= 6520; n += 250) { 
     A = new int[n];
     for (i=1; i<=n; i++)
       A[i-1] = randint(1,50000);

     timer.start();
     lines = 0;
     insertion_sort(n,A,lines);
     timer.stop();
     timer.elapsed_time(et);

     if (n <= 20)
       for (i=1; i<=n; i++)
	 cout << A[i-1] << endl;

     cout << "  n = " << n << ",\t time(in secs) " << et.user_time;
     cout << ", lines " << lines;
     cout << ", ratio sec/line " << et.user_time/lines << endl;

   }

   return(1);

}
   

