2017-10-08 17:23:46 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-09 18:39:46 +02:00
|
|
|
#include "debug/Log.hpp"
|
|
|
|
|
2017-10-08 17:23:46 +02:00
|
|
|
#include <QElapsedTimer>
|
2018-05-24 22:58:07 +02:00
|
|
|
#include <boost/noncopyable.hpp>
|
2017-10-08 17:23:46 +02:00
|
|
|
|
2018-06-26 16:37:59 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
2018-05-25 12:45:18 +02:00
|
|
|
class BenchmarkGuard : boost::noncopyable
|
|
|
|
{
|
2018-05-24 22:58:07 +02:00
|
|
|
public:
|
2018-08-11 14:20:53 +02:00
|
|
|
BenchmarkGuard(const QString &_name);
|
|
|
|
~BenchmarkGuard();
|
|
|
|
qreal getElapsedMs();
|
2018-05-24 22:58:07 +02:00
|
|
|
|
2018-08-11 14:20:53 +02:00
|
|
|
private:
|
|
|
|
QElapsedTimer timer_;
|
|
|
|
QString name_;
|
2018-05-24 22:58:07 +02:00
|
|
|
};
|
2018-06-26 16:37:59 +02:00
|
|
|
|
|
|
|
} // namespace chatterino
|