Skip to content

Commit b3638f6

Browse files
authored
Use system_clock for current wall-clock time
Replaced steady_clock with system_clock to get current time.
1 parent 0549581 commit b3638f6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/dolphin/os/OSTime.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ OSTime OSGetTime() {
5959
// GCN epoch: 2000-01-01 00:00:00 UTC = 946684800 seconds after Unix epoch
6060
static constexpr s64 gcnEpochUnix = 946684800LL;
6161

62-
// Get current wall-clock time
63-
auto elapsed = chrono::steady_clock::now() - startupSteadyTime;
64-
auto currentTime = startupTime + chrono::duration_cast<chrono::system_clock::duration>(elapsed);
62+
// Get current wall-clock time directly from system_clock
63+
auto currentTime = chrono::system_clock::now();
6564

6665
// Convert to seconds since Unix epoch, then offset to GCN epoch
6766
auto sinceUnix = chrono::duration_cast<chrono::microseconds>(currentTime.time_since_epoch());

0 commit comments

Comments
 (0)