From 96f889276f95a7c9b9882f53423556e1bf17e6a2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 May 2019 15:42:47 +0200 Subject: system/Clock: GetProcessUptimeS() returns std::chrono::duration --- src/Stats.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Stats.cxx') diff --git a/src/Stats.cxx b/src/Stats.cxx index 2bf4458fc..1e913e54f 100644 --- a/src/Stats.cxx +++ b/src/Stats.cxx @@ -114,13 +114,15 @@ db_stats_print(Response &r, const Database &db) void stats_print(Response &r, const Partition &partition) { - r.Format("uptime: %u\n" - "playtime: %lu\n", #ifdef _WIN32 - GetProcessUptimeS(), + const auto uptime = GetProcessUptimeS(); #else - (unsigned)std::chrono::duration_cast(std::chrono::steady_clock::now() - start_time).count(), + const auto uptime = std::chrono::steady_clock::now() - start_time; #endif + + r.Format("uptime: %u\n" + "playtime: %lu\n", + (unsigned)std::chrono::duration_cast(uptime).count(), std::lround(partition.pc.GetTotalPlayTime().count())); #ifdef ENABLE_DATABASE -- cgit v1.2.3