News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

What does the execution time measure?

Started by c_weed, November 24, 2011, 04:40:19 AM

Previous topic - Next topic

c_weed

What is the execution time measuring? I just got one of 18.055 s and it defiantly took less than 5 seconds.

MortenMacFly

Quote from: c_weed on November 24, 2011, 04:40:19 AM
What is the execution time measuring? I just got one of 18.055 s and it defiantly took less than 5 seconds.
See for yourself:
http://svn.berlios.de/wsvn/codeblocks/trunk/src/tools/ConsoleRunner/main.cpp?peg=7603

It's platform dependent and you didn't mention version, OS, configuration etc...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

c_weed

Windows 7 Ultimate 64 bit, AMD Turion X2 64 bit cpu. Code::blocks 10.05 compiling with gcc -wall -ansi -pendantic

thomas

It measures and displays wall clock time in millisecond resolution, using the system-provided timer (i.e. with approx 15ms accuracy under Windows, and <1ms accuracy under Linux). This includes the time to load the program as well as any time spent in waiting e.g. for useless live antivirus scanning stalling your computer before launching a program or time passing while e.g. your program displays "press any key to quit" at the end of its execution.

It is therefore very possible that the displayed time is much more than you'd think it should be.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."