X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Futil%2Ftimetaker.h;h=bc3d4a88dbd4562709a98ff86adc5b8523e105fb;hb=038da00e799b4bf3af824075a260083c56392964;hp=0b9d9ca04d2347d33bd4772147b93ad8a7e56821;hpb=979ca23f1eae1adeb8b0083dffe7203c54d87395;p=minetest.git diff --git a/src/util/timetaker.h b/src/util/timetaker.h index 0b9d9ca04..bc3d4a88d 100644 --- a/src/util/timetaker.h +++ b/src/util/timetaker.h @@ -17,10 +17,10 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef UTIL_TIMETAKER_HEADER -#define UTIL_TIMETAKER_HEADER +#pragma once -#include "../irrlichttypes.h" +#include "irrlichttypes.h" +#include "gettime.h" /* TimeTaker @@ -29,23 +29,22 @@ with this program; if not, write to the Free Software Foundation, Inc., class TimeTaker { public: - TimeTaker(const char *name, u32 *result=NULL); + TimeTaker(const std::string &name, u64 *result=nullptr, + TimePrecision prec=PRECISION_MILLI); ~TimeTaker() { stop(); } - u32 stop(bool quiet=false); + u64 stop(bool quiet=false); - u32 getTime(); + u64 getTimerTime(); private: - const char *m_name; - u32 m_time1; - bool m_running; - u32 *m_result; + std::string m_name; + u64 m_time1; + bool m_running = true; + TimePrecision m_precision; + u64 *m_result = nullptr; }; - -#endif -