system/Clock: GetProcessUptimeS() returns std::chrono::duration
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <windows.h>
|
||||
|
||||
gcc_const
|
||||
static unsigned
|
||||
static std::chrono::seconds
|
||||
DeltaFileTimeS(FILETIME a, FILETIME b)
|
||||
{
|
||||
ULARGE_INTEGER a2, b2;
|
||||
@@ -31,10 +31,10 @@ DeltaFileTimeS(FILETIME a, FILETIME b)
|
||||
b2.HighPart = b.dwHighDateTime;
|
||||
a2.LowPart = a.dwLowDateTime;
|
||||
a2.HighPart = a.dwHighDateTime;
|
||||
return (a2.QuadPart - b2.QuadPart) / 10000000;
|
||||
return std::chrono::seconds((a2.QuadPart - b2.QuadPart) / 10000000);
|
||||
}
|
||||
|
||||
unsigned
|
||||
std::chrono::seconds
|
||||
GetProcessUptimeS()
|
||||
{
|
||||
FILETIME creation_time, exit_time, kernel_time, user_time, now;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2018 The Music Player Daemon Project
|
||||
* Copyright 2003-2019 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -22,13 +22,15 @@
|
||||
|
||||
#include "util/Compiler.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
/**
|
||||
* Returns the uptime of the current process in seconds.
|
||||
*/
|
||||
gcc_pure
|
||||
unsigned
|
||||
std::chrono::seconds
|
||||
GetProcessUptimeS();
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user