9157873f5b
* Fix compilation on GCC-13 GCC-13 changes internal cstdint includes, and now files that uses standart integer types should directly include cstdint header. See: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes Bug: https://bugs.gentoo.org/865117 Bug: https://bugs.gentoo.org/895440 * Convert line endings to Unix format
33 lines
639 B
C++
33 lines
639 B
C++
/*
|
|
* IXBench.h
|
|
* Author: Benjamin Sergeant
|
|
* Copyright (c) 2017-2020 Machine Zone, Inc. All rights reserved.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace ix
|
|
{
|
|
class Bench
|
|
{
|
|
public:
|
|
Bench(const std::string& description);
|
|
~Bench();
|
|
|
|
void reset();
|
|
void record();
|
|
void report();
|
|
void setReported();
|
|
uint64_t getDuration() const;
|
|
|
|
private:
|
|
std::string _description;
|
|
std::chrono::time_point<std::chrono::high_resolution_clock> _start;
|
|
uint64_t _duration;
|
|
bool _reported;
|
|
};
|
|
} // namespace ix
|