summaryrefslogtreecommitdiff
path: root/src/Stats.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-05-08 15:42:47 +0200
committerMax Kellermann <max@musicpd.org>2019-05-08 15:58:01 +0200
commit96f889276f95a7c9b9882f53423556e1bf17e6a2 (patch)
treec289503cace2a3ea80d32cf10856b617914f93fe /src/Stats.cxx
parent214ddee2f5e3dc1c8d180a51ac3f8f9dae46cbc8 (diff)
system/Clock: GetProcessUptimeS() returns std::chrono::duration
Diffstat (limited to 'src/Stats.cxx')
-rw-r--r--src/Stats.cxx10
1 files changed, 6 insertions, 4 deletions
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::seconds>(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<std::chrono::seconds>(uptime).count(),
std::lround(partition.pc.GetTotalPlayTime().count()));
#ifdef ENABLE_DATABASE