C++Guns – RoboBlog blogging the bot

19.11.2019

C++ Guns: ACPL proudly presents: ElapsedTimer

Filed under: Allgemein — Tags: — Thomas @ 13:11

ElapsedTimer: Measure amount of time with a monotonic clock.

https://sourceforge.net/p/acpl/code/ci/master/tree/acpl/Examples/ElapsedTimer/main.cpp

#include <iostream>
#include <thread>

#include <core/util/ElapsedTimer.hpp>

using namespace acpl;
using namespace std::chrono_literals;

int main() {
    std::cout << "Start timer and wait for 2 seconds ...\n";
    auto timer = ElapsedTimer::create();
    std::this_thread::sleep_for(2s);
    std::cout << timer.elapsed().count() << " seconds later\n";
    return 0;
}

15.11.2019

C++ Guns: P1935R0 A C++ Approach to Physical Units

Filed under: Allgemein — Tags: — Thomas @ 19:11

Unbedingt lesen!!!

P1935R0 A C++ Approach to Physical Units

02.11.2019

GIT SHA hash in QT as macro created at compile time

Filed under: Allgemein — Tags: — Thomas @ 17:11

print git hash in qt as macro created at compile time

This works for me:

.pro File:
DEFINES += GIT_CURRENT_SHA1="\\\"$(shell git rev-parse HEAD)\\\""

C++ File:
std::cout << __DATE__ << " " << __TIME__ << " GIT " << GIT_CURRENT_SHA1 << "\n";

The build directory must be inside the GIT directory of the project.

Nov 2 2019 16:41:22 GIT bf2d25f47afe2c8befcfa6fefb25acbb462d43b3

Powered by WordPress