diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-05 18:58:49 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-05 18:58:49 +0100 |
| commit | 6b492daddd682de986e3f983ecfc1d29ed70b0a0 (patch) | |
| tree | 7ffffcc52e9b3f695f9cfd857b663ee16fc7dc07 /src/main_windows.cpp | |
| parent | 3979a2aaebacca290c9e6f7d2fee95b941aba32a (diff) | |
measure elapsed time for search
Diffstat (limited to 'src/main_windows.cpp')
| -rw-r--r-- | src/main_windows.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main_windows.cpp b/src/main_windows.cpp index 61f9876..f657042 100644 --- a/src/main_windows.cpp +++ b/src/main_windows.cpp @@ -33,6 +33,7 @@ static HGLRC g_hRC; static WGL_WindowData g_MainWindow; static int g_Width; static int g_Height; +LARGE_INTEGER Frequency; bool CreateDeviceWGL(HWND hWnd, WGL_WindowData* data); void CleanupDeviceWGL(HWND hWnd, WGL_WindowData* data); @@ -50,6 +51,16 @@ static const char* _ts_platform_get_config_file_path(char* buffer) { return 0; } +uint64_t ts_platform_get_time(uint64_t compare) +{ + LARGE_INTEGER stamp; + QueryPerformanceCounter(&stamp); + if (compare != 0) { + return (stamp.QuadPart - compare) * 1000 / Frequency.QuadPart; + } + return stamp.QuadPart; +} + int main(int, char**) { // Create application window @@ -92,6 +103,8 @@ int main(int, char**) ImGui_ImplWin32_InitForOpenGL(hwnd); ImGui_ImplOpenGL3_Init(); + QueryPerformanceFrequency(&Frequency); + ts_init(); ts_load_images(); |
