// gcc -g -msupersparc -lm test.c -o test // -lm is math library #include #include int main() { time_t time1, time2; double diff; double x,y; int i,j; x=2.3; y=1.0; printf("start.\n"); time1 = time(NULL); for (j=0;j<1000;j++){ for (i=0;i<10000;i++){ y = sin(x); x = exp(y); } } time2 = time(NULL); diff = difftime(time2,time1); printf("elapsed time = %f seconds. \n\n", diff); printf(" clock is %d \n", clock() ); }