48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
/*
|
|
* Created by Brett on 23/12/22.
|
|
* Licensed under GNU General Public License V3.0
|
|
* See LICENSE file for license detail
|
|
*/
|
|
|
|
#ifndef BLT_PROFILER_H
|
|
#define BLT_PROFILER_H
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <blt/config.h>
|
|
|
|
#ifdef PHMAP_ENABLED
|
|
#include <parallel_hashmap/phmap.h>
|
|
#else
|
|
#include <unordered_map>
|
|
#endif
|
|
|
|
|
|
namespace BLT {
|
|
struct CapturePoint {
|
|
long point;
|
|
};
|
|
|
|
struct CaptureInterval {
|
|
CapturePoint start;
|
|
CapturePoint end;
|
|
};
|
|
#ifdef PHMAP_ENABLED
|
|
typedef phmap::parallel_flat_hash_map<std::string_view, CaptureInterval> INTERVAL_MAP;
|
|
typedef phmap::parallel_flat_hash_map<std::string_view, CapturePoint> POINT_MAP;
|
|
#else
|
|
typedef std::unordered_map<std::string_view, CaptureInterval> INTERVAL_MAP;
|
|
typedef std::unordered_map<std::string_view, CapturePoint> POINT_MAP;
|
|
#endif
|
|
|
|
class Profiler {
|
|
private:
|
|
INTERVAL_MAP intervals;
|
|
POINT_MAP points;
|
|
public:
|
|
Profiler();
|
|
};
|
|
}
|
|
|
|
#endif //BLT_PROFILER_H
|