When we crate a program, we can get time execution from our program to know how long our program running. This is a code how to get time execution from our program with C/C++. Create a main.c file and copy this code to that file.
int main(int argc, char **argv)
t1 = time(NULL); //get time at the beginning of process
t2 = time(NULL); //get time at the end of process
divresult = div (t2-t1, 60); //compute time executed
printf("Time executed = %d min %d sec\n", divresult.quot, divresult.rem);
Compile main.c with command :
gcc main.c -o timeexec
You can copy this code to your program to get time execution from your program.