2019-07-23 22:18:36 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QElapsedTimer>
|
2021-05-08 15:57:00 +02:00
|
|
|
#include <QString>
|
2019-07-23 22:18:36 +02:00
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
namespace chatterino {
|
2019-07-23 22:18:36 +02:00
|
|
|
|
2023-09-09 12:23:20 +02:00
|
|
|
class BenchmarkGuard
|
2019-07-23 22:18:36 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
BenchmarkGuard(const QString &_name);
|
|
|
|
~BenchmarkGuard();
|
2023-09-09 12:23:20 +02:00
|
|
|
|
|
|
|
BenchmarkGuard(const BenchmarkGuard &) = delete;
|
|
|
|
BenchmarkGuard &operator=(const BenchmarkGuard &) = delete;
|
|
|
|
|
|
|
|
BenchmarkGuard(BenchmarkGuard &&) = delete;
|
|
|
|
BenchmarkGuard &operator=(BenchmarkGuard &&) = delete;
|
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
qreal getElapsedMs();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QElapsedTimer timer_;
|
|
|
|
QString name_;
|
|
|
|
};
|
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
} // namespace chatterino
|