How to check compile time?

codeblocks
compiler
memory-limit
mingw

#1

Hello

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?

Thanks


#3

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?


#4

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.


#5

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).


#6

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


#7

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


#8

Remember to use those methods when coding here :wink:


#9

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


#10

@hrculiz

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

Thanks!


#11

@fleptic Edited my answer :slight_smile:


#12

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…