Commit e4f342c16e14318f8b87f752cac1bc017d328763
1 parent
e1249c6379
Exists in
master
add prof example
Showing 1 changed file with 33 additions and 0 deletions Side-by-side Diff
lab2/test_gprof.c
View file @
e4f342c
1 | +#include<stdio.h> | |
2 | + | |
3 | + | |
4 | +void func1(void) | |
5 | +{ | |
6 | + printf("\n Inside func1 \n"); | |
7 | + int i = 0; | |
8 | + | |
9 | + for(;i<0xffffffff;i++); | |
10 | + | |
11 | + return; | |
12 | +} | |
13 | + | |
14 | + void func2(void) | |
15 | +{ | |
16 | + printf("\n Inside func2 \n"); | |
17 | + int i = 0; | |
18 | + | |
19 | + for(;i<0xffffffaa;i++); | |
20 | + return; | |
21 | +} | |
22 | + | |
23 | +int main(void) | |
24 | +{ | |
25 | + printf("\n Inside main()\n"); | |
26 | + int i = 0; | |
27 | + | |
28 | + for(;i<0xffffff;i++); | |
29 | + func1(); | |
30 | + func2(); | |
31 | + | |
32 | + return 0; | |
33 | +} |