I am running a lot of C++ and C code in VSCode, and I have noticed that while my compilation is relatively fast (g++ test.cpp), when I execute the code (./a.exe) there is about a 3 second gap between pressing enter and the code executing.
Here is an example program, that took almost 3 seconds to run:
#include <iostream>
int main(){
for(int i = 0; i< 50; i++){
std::cout << i << std::endl;
}
return 0;
}
I have noticed this problem on pretty much all my C++/C programs. To reiterate, I believe there is a 3 second gap between hitting enter and actual execution of the program.
I have tried a lot of different things, I have cleared RAM cache, I have deleted temporary files, restarted countless times, but I am unable to find the problem. Additionally, I have noticed that my computer's battery has started running out pretty quickly, but I am not sure if that is related.
If anyone has any tips or has experienced this problem, please let me know so I can fix this really annoying issue.