mirror-chatterino2/src/debug/Benchmark.hpp

23 lines
352 B
C++
Raw Normal View History

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>
#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
{
public:
2018-08-11 14:20:53 +02:00
BenchmarkGuard(const QString &_name);
~BenchmarkGuard();
qreal getElapsedMs();
2018-08-11 14:20:53 +02:00
private:
QElapsedTimer timer_;
QString name_;
};
2018-06-26 16:37:59 +02:00
} // namespace chatterino