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

Function main

code/Chapter2/2-4.c:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

gettimeofdayFunction · 0.85
matrixmultiFunction · 0.70

Tested by

no test coverage detected