gyp fixes
This commit is contained in:
40
include/mbgl/util/stopwatch.hpp
Normal file
40
include/mbgl/util/stopwatch.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef MBGL_UTIL_STOPWATCH
|
||||
#define MBGL_UTIL_STOPWATCH
|
||||
|
||||
#include <mbgl/platform/event.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
#ifndef DISABLE_STOPWATCH
|
||||
class stopwatch {
|
||||
public:
|
||||
stopwatch(Event event = Event::General);
|
||||
stopwatch(EventSeverity severity, Event event = Event::General);
|
||||
stopwatch(const std::string &name, Event event = Event::General);
|
||||
stopwatch(const std::string &name, EventSeverity severity, Event event = Event::General);
|
||||
void report(const std::string &name);
|
||||
~stopwatch();
|
||||
|
||||
private:
|
||||
const std::string name;
|
||||
EventSeverity severity = EventSeverity::Debug;
|
||||
Event event = Event::General;
|
||||
uint64_t start;
|
||||
};
|
||||
#else
|
||||
class stopwatch {
|
||||
inline stopwatch(Event event = Event::General);
|
||||
inline stopwatch(EventSeverity severity, Event event = Event::General);
|
||||
inline stopwatch(const std::string &name, Event event = Event::General);
|
||||
inline stopwatch(const std::string &name, EventSeverity severity, Event event = Event::General);
|
||||
inline void report(const std::string &name) {}
|
||||
inline ~stopwatch() {}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,40 +0,0 @@
|
||||
#ifndef MBGL_UTIL_TIMER
|
||||
#define MBGL_UTIL_TIMER
|
||||
|
||||
#include <mbgl/platform/event.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
#ifndef DISABLE_TIMER
|
||||
class timer {
|
||||
public:
|
||||
timer(Event event = Event::General);
|
||||
timer(EventSeverity severity, Event event = Event::General);
|
||||
timer(const std::string &name, Event event = Event::General);
|
||||
timer(const std::string &name, EventSeverity severity, Event event = Event::General);
|
||||
void report(const std::string &name);
|
||||
~timer();
|
||||
|
||||
private:
|
||||
const std::string name;
|
||||
EventSeverity severity = EventSeverity::Debug;
|
||||
Event event = Event::General;
|
||||
uint64_t start;
|
||||
};
|
||||
#else
|
||||
class timer {
|
||||
inline timer(Event event = Event::General);
|
||||
inline timer(EventSeverity severity, Event event = Event::General);
|
||||
inline timer(const std::string &name, Event event = Event::General);
|
||||
inline timer(const std::string &name, EventSeverity severity, Event event = Event::General);
|
||||
inline void report(const std::string &name) {}
|
||||
inline ~timer() {}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user