mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
/proc/stat might be inaccessible.
This commit is contained in:
parent
cffc6e21d3
commit
2c9d9d0d27
@ -43,10 +43,12 @@ void SysTime::ReadTimes()
|
||||
{
|
||||
uint64_t user, nice, system;
|
||||
FILE* f = fopen( "/proc/stat", "r" );
|
||||
assert( f );
|
||||
fscanf( f, "cpu %" PRIu64 " %" PRIu64 " %" PRIu64" %" PRIu64, &user, &nice, &system, &idle );
|
||||
fclose( f );
|
||||
used = user + nice + system;
|
||||
if( f )
|
||||
{
|
||||
fscanf( f, "cpu %" PRIu64 " %" PRIu64 " %" PRIu64" %" PRIu64, &user, &nice, &system, &idle );
|
||||
fclose( f );
|
||||
used = user + nice + system;
|
||||
}
|
||||
}
|
||||
|
||||
# elif defined __APPLE__
|
||||
|
Loading…
Reference in New Issue
Block a user