A problem: On some systems, the timing function gives times in multiples of .01 seconds. On others, the timing coarseness may be significantly smaller or larger. (You should determine the timing coarseness for your machine.) Thus, for example, on a system with .01 second timing coarseness, timing anything which takes less than one fiftieth of a second could result in more than a 50% error. Your programs, for small values of n, should be easily this fast.
A solution: When the algorithm to be timed is too fast to obtain an accurate measurement, the algorithm can be run many times in succession, with the cumulative time being measured. This time can then be divided by the number of runs to obtain a more accurate measurement of the time required by an individual run. As little as possible, other then the successive calls, should occur while the timing is taking place.
Header file timer.h declares the routines that are defined in timer.c and it should be included in all program files that invoke any of those routines.
Note that the MinGW system does not have the proper version of include timing files. If you were to try to compile the timer.c program file in MinGW, you would get compilation errors. Accordingly, for your own personal use (not to be used for course submissions), you may make use of file timerMinGW.c instead, which I believe should work on the MinGW system.