You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Remove OS.get_system_time_secs/get_system_time_msecs and change OS.get_unix_time return type to double
This commit is contained in:
@@ -163,22 +163,12 @@ String OS_Unix::get_name() const {
|
||||
return "Unix";
|
||||
}
|
||||
|
||||
uint64_t OS_Unix::get_unix_time() const {
|
||||
return time(nullptr);
|
||||
double OS_Unix::get_unix_time() const {
|
||||
struct timeval tv_now;
|
||||
gettimeofday(&tv_now, nullptr);
|
||||
return (double)tv_now.tv_sec + double(tv_now.tv_usec) / 1000000;
|
||||
};
|
||||
|
||||
uint64_t OS_Unix::get_system_time_secs() const {
|
||||
struct timeval tv_now;
|
||||
gettimeofday(&tv_now, nullptr);
|
||||
return uint64_t(tv_now.tv_sec);
|
||||
}
|
||||
|
||||
uint64_t OS_Unix::get_system_time_msecs() const {
|
||||
struct timeval tv_now;
|
||||
gettimeofday(&tv_now, nullptr);
|
||||
return uint64_t(tv_now.tv_sec) * 1000 + uint64_t(tv_now.tv_usec) / 1000;
|
||||
}
|
||||
|
||||
OS::Date OS_Unix::get_date(bool utc) const {
|
||||
time_t t = time(nullptr);
|
||||
struct tm *lt;
|
||||
|
||||
Reference in New Issue
Block a user