Reputation: 13
I got a competition from programming and in problems,there is a timelimit(0.1seconds).So,I need to check if my program works well before I upload it(if it does not compile more than 0.1 seconds). How can I check it? Thanks in advance,
Upvotes: 1
Views: 2031
Reputation: 1
The dev-C++ compiler always says the time it takes to run when the program finishes running. Borland also does but I wouldn't recomend using that because it's a lot of working in the command line with that compiler. If you're using code that requires user input that would delay the time that the program takes to run due to human response time.
Upvotes: 0
Reputation:
On debian linux you can run time g++ your_program.cpp -o outputName
and it will output the real, user, and system time
Upvotes: 0
Reputation: 36433
Compilation time on a remote machine is nothing you can determine on your local machine (unless both machines are identical with respect respect to soft- and hardware and things they are concurrently executing, events interrupting the compiler etc), so there's nothing you can do to achieve this.
Upvotes: 3