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

Function main

code/Chapter2/2-5.c:18–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 }
17}
18int main(){
19 for (i = 0; i < n; i++)
20 {
21 for (j = 0; j < n; j++)
22 {
23 y[i][j] = rand() % 10;
24 z[i][j] = rand() % 10;
25 x[i][j] = 0;
26 }
27 }
28struct timeval starttime,endtime;
29 gettimeofday(&starttime,0);
30 matrixmulti(n, x, y, z);
31gettimeofday(&endtime,0);
32 doubletimeuse=(endtime.tv_sec-starttime.tv_sec)+(endtime.tv_usec-starttime.tv_usec)/1000000.0;
33 printf("run time = %f s\n", timeuse);
34return 0;
35}

Callers

nothing calls this directly

Calls 2

gettimeofdayFunction · 0.85
matrixmultiFunction · 0.70

Tested by

no test coverage detected