#include #define ifreq 10000000 void main() { struct { double real; double imag; } d,c; int i; double tmp, seconds; extern void startwatch_(); extern void checkwatch_(double *); c.real = cos(2*acos(-1.)/ifreq); c.imag = sin(2*acos(-1.)/ifreq); d.real = 1.; d.imag = 0.1; startwatch_ (); for (i=1;i<=ifreq;i++) { tmp = d.real*c.real - d.imag*c.imag; d.imag = d.real*c.imag + d.imag*c.real; d.real = tmp; } checkwatch_ (&seconds); printf("d = (%e %e)\n", d.real, d.imag); printf("seconds = %f\n", seconds); }