mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 14:42:24 +01:00
Slap u64 on everything time-y (#10984)
This commit is contained in:
parent
d51d0d77c4
commit
b5eda416ce
@ -3268,7 +3268,6 @@ Helper functions
|
|||||||
* returns true when the passed number represents NaN.
|
* returns true when the passed number represents NaN.
|
||||||
* `minetest.get_us_time()`
|
* `minetest.get_us_time()`
|
||||||
* returns time with microsecond precision. May not return wall time.
|
* returns time with microsecond precision. May not return wall time.
|
||||||
* This value might overflow on certain 32-bit systems!
|
|
||||||
* `table.copy(table)`: returns a table
|
* `table.copy(table)`: returns a table
|
||||||
* returns a deep copy of `table`
|
* returns a deep copy of `table`
|
||||||
* `table.indexof(list, val)`: returns the smallest numerical index containing
|
* `table.indexof(list, val)`: returns the smallest numerical index containing
|
||||||
|
@ -234,21 +234,21 @@ inline u64 getTimeMs()
|
|||||||
{
|
{
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
os_get_clock(&ts);
|
os_get_clock(&ts);
|
||||||
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
|
return ((u64) ts.tv_sec) * 1000LL + ((u64) ts.tv_nsec) / 1000000LL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u64 getTimeUs()
|
inline u64 getTimeUs()
|
||||||
{
|
{
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
os_get_clock(&ts);
|
os_get_clock(&ts);
|
||||||
return ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
|
return ((u64) ts.tv_sec) * 1000000LL + ((u64) ts.tv_nsec) / 1000LL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u64 getTimeNs()
|
inline u64 getTimeNs()
|
||||||
{
|
{
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
os_get_clock(&ts);
|
os_get_clock(&ts);
|
||||||
return ts.tv_sec * 1000000000 + ts.tv_nsec;
|
return ((u64) ts.tv_sec) * 1000000000LL + ((u64) ts.tv_nsec);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user