Expose getPointedThing to Lua
[oweals/minetest.git] / src / util / timetaker.h
index 8aad97d0f34935e456e965df7759714bb1a4fd48..34564ee4bbd9a5c9bd705ebb48c6f20696b016e7 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define UTIL_TIMETAKER_HEADER
 
 #include "../irrlichttypes.h"
+#include "../gettime.h"
 
 /*
        TimeTaker
@@ -29,22 +30,24 @@ 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