#include <stdio.h>
#include
<time.h>
/* need time.h in order to call clock()*/
void computing()
{
time_t t0, t1;
clock_t c0
, c1;
long count;
double a, b, c;
t0 = time(NULL);
c0 = clock();
for
(count = 1l; count < 10000000l; count++)
{
a
= sqrt(count);
b = 1.0/a;
c = b - a;
}
t1 = time(NULL);
c1 = clock();
printf("\n%d clocks per second\n" , (int)CLOCKS_PER_SEC);
printf("\n The number of clocks : %d\n" , (int)c1 -
(int)c0);
printf("\n Time to
perform : %f\n" , (float)((int)c1 -
(int)c0 / CLOCKS_PER_SEC));
}
void main()
{
computing();
}
----------------- Here is the output---------------------------------
200000000 clocks per second
The number of clocks : 0
Time to perform : 0.000000
------