atimer.h
/*
*openPilotLog - A FOSS Pilot Logbook Application
*Copyright (C) 2020-2022 Felix Turowsky
*
*This program is free software: you can redistribute it and/or modify
*it under the terms of the GNU General Public License as published by
*the Free Software Foundation, either version 3 of the License, or
*(at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef ATIMER_H
#define ATIMER_H
#include <QObject>
#include <chrono>
#include <QDebug>
#include "src/functions/log.h"
class ATimer : public QObject
{
Q_OBJECT
public:
ATimer(QObject* parent = nullptr);
~ATimer();
long timeNow();
private:
std::chrono::high_resolution_clock::time_point start;
std::chrono::high_resolution_clock::time_point intermediate_point;
std::chrono::high_resolution_clock::time_point stop;
double duration;
};
#endif // ATIMER_H
ATimer
The ATimer class provides an easy to use performance timer.
Definition: atimer.h:36
ATimer::timeNow
long timeNow()
timeNow takes an intermediate timing and returns miliseconds elapsed.
Definition: atimer.cpp:47