See Compilation Time in c++ Program
#include <bits/stdc++.h>
#include<chrono>
using namespace std;
auto start = chrono::steady_clock::now();
int main(){
cout<<"My name is Devil"<<endl;
auto end= chrono::steady_clock::now();
auto diff = end - start;
cout<<chrono::duration<double,milli>(diff).count()<<" ms"<<endl;
return 0;
}