mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-28 17:16:46 +00:00
added get milliseconds
This commit is contained in:
@@ -51,6 +51,26 @@ std::optional<std::filesystem::path> Util::NvngxPath()
|
||||
return result;
|
||||
}
|
||||
|
||||
double Util::MillisecondsNow()
|
||||
{
|
||||
static LARGE_INTEGER s_frequency;
|
||||
static BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency);
|
||||
double milliseconds = 0;
|
||||
|
||||
if (s_use_qpc)
|
||||
{
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
milliseconds = double(1000.0 * now.QuadPart) / s_frequency.QuadPart;
|
||||
}
|
||||
else
|
||||
{
|
||||
milliseconds = double(GetTickCount64());
|
||||
}
|
||||
|
||||
return milliseconds;
|
||||
}
|
||||
|
||||
std::filesystem::path Util::ExePath()
|
||||
{
|
||||
static std::filesystem::path exe;
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace Util
|
||||
std::filesystem::path ExePath();
|
||||
std::filesystem::path DllPath();
|
||||
std::optional<std::filesystem::path> NvngxPath();
|
||||
double MillisecondsNow();
|
||||
|
||||
|
||||
HWND GetProcessWindow();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user