From e4f342c16e14318f8b87f752cac1bc017d328763 Mon Sep 17 00:00:00 2001 From: kmazouzi Date: Tue, 22 Mar 2016 20:13:05 +0100 Subject: [PATCH] add prof example --- lab2/test_gprof.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lab2/test_gprof.c diff --git a/lab2/test_gprof.c b/lab2/test_gprof.c new file mode 100644 index 0000000..37419cc --- /dev/null +++ b/lab2/test_gprof.c @@ -0,0 +1,33 @@ +#include + + +void func1(void) +{ + printf("\n Inside func1 \n"); + int i = 0; + + for(;i<0xffffffff;i++); + + return; +} + + void func2(void) +{ + printf("\n Inside func2 \n"); + int i = 0; + + for(;i<0xffffffaa;i++); + return; +} + +int main(void) +{ + printf("\n Inside main()\n"); + int i = 0; + + for(;i<0xffffff;i++); + func1(); + func2(); + + return 0; +} -- 1.7.10.4