Author Topic: What does the execution time measure?  (Read 13181 times)

Offline c_weed

  • Single posting newcomer
  • *
  • Posts: 9
What does the execution time measure?
« 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: What does the execution time measure?
« Reply #1 on: November 24, 2011, 07:27:37 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline c_weed

  • Single posting newcomer
  • *
  • Posts: 9
Re: What does the execution time measure?
« Reply #2 on: November 24, 2011, 08:14:25 am »
Windows 7 Ultimate 64 bit, AMD Turion X2 64 bit cpu. Code::blocks 10.05 compiling with gcc -wall -ansi -pendantic

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: What does the execution time measure?
« Reply #3 on: November 24, 2011, 09:48:47 am »
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."