Execution lifetime of a C/C++ program

Hello experts,
To create my own one I need each of code or instruction to get that in the execution lifetime of a C/C++ program.
For selecting data from memory to the CPU how many times it goes to the memory and by data pitching procedure how much time is in use?
Please give me a solution.
Thanks in advance.
