MCPcopy Create free account
hub / github.com/AdvancedCompiler/AdvancedCompiler / main

Function main

code/Chapter2/2-2.c:7–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5int a[N],b[N],c[N];
6int i;
7int main(){
8 for(i= 0; i <N; i++){
9 a[i]=i+ 1;
10 b[i]=i+2;
11 c[i]=i+3;
12}
13 struct timeval start,end;
14 gettimeofday(&start,NULL);
15 for (i=0; i<N;i++)
16 c[i]=c[i]+a[i]*b[i];
17 gettimeofday(&end,NULL);
18 double timeuse=(end.tv_sec-start.tv_sec)+(end.tv_usec-start.tv_usec)/1000000.0;
19 printf("time=%f\n",timeuse);
20 return 0;
21}

Callers

nothing calls this directly

Calls 1

gettimeofdayFunction · 0.85

Tested by

no test coverage detected