mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Fix a bug where system time always equals user time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b6628997f
commit
7d05563324
@ -105,12 +105,19 @@ static TimeRecord getTimeRecord(bool Start) {
|
||||
sys::TimeValue user(0,0);
|
||||
sys::TimeValue sys(0,0);
|
||||
|
||||
sys::Process::GetTimeUsage(now,user,sys);
|
||||
long MemUsed = 0;
|
||||
if (Start) {
|
||||
sys::Process::GetTimeUsage(now,user,sys);
|
||||
MemUsed = sys::Process::GetMallocUsage();
|
||||
} else {
|
||||
MemUsed = sys::Process::GetMallocUsage();
|
||||
sys::Process::GetTimeUsage(now,user,sys);
|
||||
}
|
||||
|
||||
Result.Elapsed = now.seconds() + now.microseconds() / 1000000.0;
|
||||
Result.UserTime = user.seconds() + user.microseconds() / 1000000.0;
|
||||
Result.UserTime = sys.seconds() + sys.microseconds() / 1000000.0;
|
||||
Result.MemUsed = sys::Process::GetMallocUsage();
|
||||
Result.Elapsed = now.seconds() + now.microseconds() / 1000000.0;
|
||||
Result.UserTime = user.seconds() + user.microseconds() / 1000000.0;
|
||||
Result.SystemTime = sys.seconds() + sys.microseconds() / 1000000.0;
|
||||
Result.MemUsed = MemUsed;
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user