mirror-chatterino2/src/debug/Benchmark.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
518 B
C++
Raw Normal View History

#pragma once
#include <QElapsedTimer>
#include <QString>
2019-10-07 15:46:08 +02:00
namespace chatterino {
class BenchmarkGuard
{
public:
BenchmarkGuard(const QString &_name);
~BenchmarkGuard();
BenchmarkGuard(const BenchmarkGuard &) = delete;
BenchmarkGuard &operator=(const BenchmarkGuard &) = delete;
BenchmarkGuard(BenchmarkGuard &&) = delete;
BenchmarkGuard &operator=(BenchmarkGuard &&) = delete;
qreal getElapsedMs();
private:
QElapsedTimer timer_;
QString name_;
};
2019-10-07 15:46:08 +02:00
} // namespace chatterino