Here is a sample code that measures time. It works in Borland. #include #include #include int main(void) { clock_t start, end; start = clock(); // code to test goes here end = clock(); printf("The time was: %f\n", (end - start) / CLK_TCK); return 0; } Few things to remember: - you are measuring a quantity that has a variance - the timer precision is dependent on the operating system and the computer, and therefore may not be very accurate when measuring very short time interval Therefore it is better to run the measurement N times and then divide the time it took to run by N. This both averages all the trials and measures a longer interval. so you may want to do something like this: clock_t start, end; start = clock(); for (i=0; i