feat add tracy profiler
Some checks failed
cpp-template / build (Debug, aarch64-linux-gnu) (push) Failing after 27s
cpp-template / build (Release, mipsel-linux-gnu) (push) Failing after 12m45s
cpp-template / build (Release, host.gcc) (push) Failing after 12m52s
cpp-template / build (Release, arm-linux-gnueabihf) (push) Failing after 12m55s
cpp-template / build (Release, aarch64-linux-gnu) (push) Failing after 13m1s
cpp-template / build (Debug, mipsel-linux-gnu) (push) Failing after 13m6s
cpp-template / build (Debug, host.gcc) (push) Failing after 13m11s
cpp-template / build (Debug, arm-linux-gnueabihf) (push) Failing after 13m19s
Some checks failed
cpp-template / build (Debug, aarch64-linux-gnu) (push) Failing after 27s
cpp-template / build (Release, mipsel-linux-gnu) (push) Failing after 12m45s
cpp-template / build (Release, host.gcc) (push) Failing after 12m52s
cpp-template / build (Release, arm-linux-gnueabihf) (push) Failing after 12m55s
cpp-template / build (Release, aarch64-linux-gnu) (push) Failing after 13m1s
cpp-template / build (Debug, mipsel-linux-gnu) (push) Failing after 13m6s
cpp-template / build (Debug, host.gcc) (push) Failing after 13m11s
cpp-template / build (Debug, arm-linux-gnueabihf) (push) Failing after 13m19s
This commit is contained in:
14
third_party/tracy/public/client/TracySysTime.cpp
vendored
14
third_party/tracy/public/client/TracySysTime.cpp
vendored
@@ -4,6 +4,7 @@
|
||||
|
||||
# if defined _WIN32
|
||||
# include <windows.h>
|
||||
# include "../common/TracyWinFamily.hpp"
|
||||
# elif defined __linux__
|
||||
# include <stdio.h>
|
||||
# include <inttypes.h>
|
||||
@@ -27,13 +28,24 @@ static inline uint64_t ConvertTime( const FILETIME& t )
|
||||
|
||||
void SysTime::ReadTimes()
|
||||
{
|
||||
FILETIME idleTime;
|
||||
FILETIME kernelTime;
|
||||
FILETIME userTime;
|
||||
|
||||
# if defined TRACY_GDK
|
||||
FILETIME creationTime;
|
||||
FILETIME exitTime;
|
||||
|
||||
GetProcessTimes( GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime );
|
||||
|
||||
idle = 0;
|
||||
# else
|
||||
FILETIME idleTime;
|
||||
|
||||
GetSystemTimes( &idleTime, &kernelTime, &userTime );
|
||||
|
||||
idle = ConvertTime( idleTime );
|
||||
# endif
|
||||
|
||||
const auto kernel = ConvertTime( kernelTime );
|
||||
const auto user = ConvertTime( userTime );
|
||||
used = kernel + user;
|
||||
|
Reference in New Issue
Block a user