mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Clean up getTime helpers
This increases size of the getTime return values to 64 bits. It also removes the TimeGetter classes since the getTime functions are now very precise.
This commit is contained in:
parent
7f4cdbcbe9
commit
b662a4577d
22 changed files with 116 additions and 216 deletions
|
@ -21,33 +21,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define GETTIME_HEADER
|
||||
|
||||
#include "irrlichttypes.h"
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
|
||||
/*
|
||||
Get a millisecond counter value.
|
||||
Precision depends on implementation.
|
||||
Overflows at any value above 10000000.
|
||||
|
||||
Implementation of this is done in:
|
||||
Normal build: main.cpp
|
||||
Server build: servermain.cpp
|
||||
*/
|
||||
enum TimePrecision
|
||||
{
|
||||
PRECISION_SECONDS = 0,
|
||||
PRECISION_SECONDS,
|
||||
PRECISION_MILLI,
|
||||
PRECISION_MICRO,
|
||||
PRECISION_NANO
|
||||
};
|
||||
|
||||
extern u32 getTimeMs();
|
||||
extern u32 getTime(TimePrecision prec);
|
||||
|
||||
/*
|
||||
Timestamp stuff
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <time.h>
|
||||
|
||||
inline std::string getTimestamp()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue