Browse Source

Implement system::getThreadTime() on Windows.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
e29a98a8aa
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/system.cpp

+ 7
- 1
src/system.cpp View File

@@ -711,7 +711,13 @@ double getThreadTime() {
return 0.0;
return info.user_time.seconds + info.user_time.microseconds * 1e-6;
#elif defined ARCH_WIN
return 0.0;
FILETIME creationTime;
FILETIME exitTime;
FILETIME kernelTime;
FILETIME userTime;
if (GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime) == 0)
return 0.0;
return ((uint64_t(userTime.dwHighDateTime) << 32) + userTime.dwLowDateTime) * 1e-7;
#endif
}



Loading…
Cancel
Save