Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Print build time

    Tools
    2
    3
    3090
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Hostel last edited by

      Is there any method to print a build time? I see that Qt Creator or qmake prints a message when make starts and stops. I want to print at the end of the build difference between them.

      Example of Compile Output:
      @
      15:02:05: Running build steps for project untitled...
      15:02:06: Starting: "/usr/bin/qmake-qt4" /tmp/untitled/untitled.pro -r -spec linux-g++
      15:02:06: The process "/usr/bin/qmake-qt4" exited normally.
      15:02:06: Starting: "/usr/bin/make" -w
      make: Entering directory /tmp/untitled-build-desktop-Qt_4_7_4_w_PATH__System__Release' g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I../untitled -I/usr/include/QtCore -I/usr/include -I. -I../untitled -I. -o main.o ../untitled/main.cpp g++ -Wl,-O1 -o untitled main.o -L/usr/lib64 -lQtCore -lpthread make: Leaving directory /tmp/untitled-build-desktop-Qt_4_7_4_w_PATH__System__Release'
      15:02:06: The process "/usr/bin/make" exited normally.

      // here I want to print differences between the times
      @

      1 Reply Last reply Reply Quote 0
      • T
        tobias.hunger last edited by

        Qt Creator adds those time stamps.

        A good way to get the desired time difference on linux/mac is to just add "time" in front of the call: It will measure different time values (cpu time, wallclock time) and print it once the application is done.

        1 Reply Last reply Reply Quote 0
        • H
          Hostel last edited by

          Thanks, I forget about time, but this works outside Qt Creator. There is a another solution, which will work inside Qt Creator?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post