How to check compile time?




Is there a way (I know there must be one, only I’m not aware) to check the program memory, compile time and call stack in Code::Blocks with MinGW 4.7.2?



Probably you are not interested in compile time, but running time, right? Also call stack, you want to know how deep the call stack is or what or max deep during execution?


By compile time, I mean I want to know how long the code took to compile? I was trying to solve this trivial question. But I exceed the time limit every time. I saw some of the other user’s solutions but still I don’t understand why my code exceeds time limit.


Compilation is a process, when compiler compiles your source code (.cpp) to executable (.exe) and I think you are not interested in this time (TopCoder has time limit for compile time in marathon matches for example).


You are using cin and cout which is slow and this problem targets this, try to read some threads about this in forum…


Thanks! using scanf() and printf() worked.


Remember to use those methods when coding here :wink:


Now, I could submit it. And thanks for explaining me about my misconception about compile time (i.e., runtime).



BTW how can I check the time required to process the input into required outputs in gcc?



@fleptic Edited my answer :slight_smile:


I have to add one more warning, you can find time to process input, but it is also input dependent. It’s natural, that for bigger input it takes longer…