#include #include #include int pic[350][350]; char *thetime; struct _timeb t1,t2; long s,m; #define WEIGHT 1 int k[3][3] = {{ -1, 0, 1}, { -2, 0, 2}, { -1, 0, 1}}; void main(int argc, char **argv) { int i,j; _ftime(&t1); for (i=0;i<348;i++) for(j=0;j<348;j++) { pic[i][j]= (k[0][0]*pic[i ][j ]+k[0][1]*pic[i][j+1]+k[0][2]*pic[i][j+2] +k[1][0]*pic[i+1][j ]+k[1][1]*pic[i+1][j+1]+k[1][2]*pic[i+1][j+2] +k[2][0]*pic[i+2][j ]+k[2][1]*pic[i+2][j+1]+k[2][2]*pic[i+2][j+2])/WEIGHT; } _ftime(&t2); thetime=ctime(&(t1.time)); printf("Start: %.19s.%hu %s",thetime,t1.millitm,&thetime[20]); thetime=ctime(&(t2.time)); printf("End : %.19s.%hu %s",thetime,t2.millitm,&thetime[20]); printf("Diff : %d ms\n",1000*(t2.time-t1.time)+(t2.millitm-t1.millitm)); }