If you need compilation time of the C program you can use the time command in linux environment .

time cc testing.c

But inside a program we can only get the run time by some of the time calculations.We can not get the compilation time.