mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Replace std::time
with std::chrono::system_clock
This commit is contained in:
parent
ff1c71cc38
commit
083b8172e0
@ -241,7 +241,10 @@ IPCReply DolphinDevice::GetSystemTime(const IOCtlVRequest& request) const
|
||||
return IPCReply(IPC_EINVAL);
|
||||
}
|
||||
|
||||
const u64 milliseconds = std::time(nullptr);
|
||||
// Write Unix timestamp in milliseconds to memory address
|
||||
const u64 milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
Memory::Write_U64(milliseconds, request.io_vectors[0].address);
|
||||
return IPCReply(IPC_SUCCESS);
|
||||
}
|
||||
|
@ -290,7 +290,9 @@ void UpdateDiscordPresence(int party_size, SecretType type, const std::string& s
|
||||
discord_presence.smallImageText = "Dolphin is an emulator for the GameCube and the Wii.";
|
||||
}
|
||||
discord_presence.details = title.empty() ? "Not in-game" : title.c_str();
|
||||
discord_presence.startTimestamp = std::time(nullptr);
|
||||
discord_presence.startTimestamp = std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
|
||||
if (party_size > 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user