#include <stdio.h>
#include <stdlib.h>
#include <time.h>

// this program demonstrates how to measure the run time of a program (in seconds)

int main()
{
	time_t  startTime;
	time_t  endTime;

	startTime = time(NULL);   // get the current time
	
	// do some busy work  here
	int i;
	for(i=0; i< 10000; i++)
	  printf("%d\n", i);

	endTime = time(NULL);   // get the current time again
	
	time_t elapsedTime = endTime - startTime;
	
	printf("This program took %d seconds to run.\n", elapsedTime); 
	
	system("pause");
}