projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HTTP API: Allow binary downloads and headers (#8573)
[oweals/minetest.git]
/
src
/
util
/
timetaker.h
diff --git
a/src/util/timetaker.h
b/src/util/timetaker.h
index 75542f433c1a1adbb828d39ae3f2c9ba0f952d21..bc3d4a88dbd4562709a98ff86adc5b8523e105fb 100644
(file)
--- a/
src/util/timetaker.h
+++ b/
src/util/timetaker.h
@@
-1,6
+1,6
@@
/*
Minetest
/*
Minetest
-Copyright (C) 2010-201
2
celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2010-201
3
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
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
@@
-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.
*/
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
/*
TimeTaker
@@
-29,23
+29,22
@@
with this program; if not, write to the Free Software Foundation, Inc.,
class TimeTaker
{
public:
class TimeTaker
{
public:
- TimeTaker(const char *name, u32 *result=NULL);
+ TimeTaker(const std::string &name, u64 *result=nullptr,
+ TimePrecision prec=PRECISION_MILLI);
~TimeTaker()
{
stop();
}
~TimeTaker()
{
stop();
}
- u
32
stop(bool quiet=false);
+ u
64
stop(bool quiet=false);
- u
32 get
Time();
+ u
64 getTimer
Time();
private:
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
-