IXWebSocket/ixwebsocket/IXBench.h

33 lines
640 B
C
Raw Normal View History

/*
* IXBench.h
* Author: Benjamin Sergeant
* Copyright (c) 2017-2020 Machine Zone, Inc. All rights reserved.
*/
2020-08-16 03:58:46 +02:00
#pragma once
#include <chrono>
#include <stdint.h>
2020-03-25 04:37:55 +01:00
#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;
};
2020-03-25 04:37:55 +01:00
} // namespace ix