2017-04-01 11:10:38 -07:00
|
|
|
#ifndef VOXEL_PROFILING_H
|
|
|
|
#define VOXEL_PROFILING_H
|
|
|
|
|
|
|
|
#define VOXEL_PROFILING
|
|
|
|
|
|
|
|
#ifdef VOXEL_PROFILING
|
|
|
|
|
|
|
|
#include <dictionary.h>
|
|
|
|
#include <hash_map.h>
|
2017-08-12 16:19:39 -07:00
|
|
|
#include <ustring.h>
|
2017-04-01 11:10:38 -07:00
|
|
|
|
|
|
|
#define VOXEL_PROFILE_BEGIN(_key) _zprofiler.begin(_key);
|
|
|
|
#define VOXEL_PROFILE_END(_key) _zprofiler.end(_key);
|
|
|
|
|
|
|
|
class ZProfileVar;
|
|
|
|
|
|
|
|
class ZProfiler {
|
|
|
|
public:
|
|
|
|
//static ZProfiler & get();
|
|
|
|
~ZProfiler();
|
|
|
|
|
|
|
|
void begin(String key);
|
|
|
|
void end(String key);
|
|
|
|
|
|
|
|
Dictionary get_all_serialized_info() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
//ZProfiler();
|
2017-08-12 16:19:39 -07:00
|
|
|
ZProfileVar *get_var(String key);
|
2017-04-01 11:10:38 -07:00
|
|
|
|
2017-08-12 16:19:39 -07:00
|
|
|
HashMap<String, ZProfileVar *> _vars;
|
2017-04-01 11:10:38 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define VOXEL_PROFILE_BEGIN(_key) //
|
|
|
|
#define VOXEL_PROFILE_END(_key) //
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // VOXEL_PROFILING_H
|