How to get building time w QT Creator
-
wrote on 16 Feb 2023, 19:08 last edited by
Need to output total building time.
If possible, please advise for compilation time too -
Need to output total building time.
If possible, please advise for compilation time too@icebergenergy Just look at the bottom of "Compilation output" pane after you build, Qt Creator always writes how long it took.
-
wrote on 17 Feb 2023, 17:40 last edited by
OK! how is there a way to get same + miliseconds?
-
OK! how is there a way to get same + miliseconds?
wrote on 17 Feb 2023, 17:57 last edited by@icebergenergy
I wouldn't have thought you can choose its output format. But for milliseconds you realize it's calling qmake/cmake, and that will be calling up compilers and linkers.... How accurate or useful will milliseconds be here? -
Yes, miliseconds is an overkill. You will get different results in seconds for different runs. Compilation time depends on a lot of things you have little control over:
- maybe OS is doing something in the background?
- antivirus can be scanning some file just as you build your project
- your CPU is a bit hotter because it did some heavy tasks a few seconds ago, so boost clocks will behave differently
- maybe the day is a bit warmer and will affect boost clocks as well
- is cmake cache cold, does cmake need to re-run?
- is ccache used?
- is unity build used?
- and many, many more
On my current project, the whole compilation (when both ccache and unity builds are turned off) will take about 2 minutes +- 5 seconds. Using miliseconds here gives no benefit, it might only prompt you to do needless optimisation.
1/5