[llvm-commits] [llvm] r171551 - in /llvm/trunk: autoconf/configure.ac cmake/config-ix.cmake cmake/modules/LLVM-Config.cmake configure include/llvm/Support/Process.h lib/Support/Process.cpp lib/Support/Unix/Process.inc lib/Support/Windows/Process.inc unittests/Support/ProcessTest.cpp
Reid Kleckner
rnk at google.com
Fri Jan 4 15:38:49 PST 2013
-void
> -Process::GetTimeUsage(
> - TimeValue& elapsed, TimeValue& user_time, TimeValue& sys_time)
> -{
> +void Process::GetTimeUsage(TimeValue &elapsed, TimeValue &user_time,
> + TimeValue &sys_time) {
> elapsed = TimeValue::now();
>
> - uint64_t ProcCreate, ProcExit, KernelTime, UserTime;
> - GetProcessTimes(GetCurrentProcess(), (FILETIME*)&ProcCreate,
> - (FILETIME*)&ProcExit, (FILETIME*)&KernelTime,
> - (FILETIME*)&UserTime);
> + FILETIME ProcCreate, ProcExit, KernelTime, UserTime;
> + if (GetProcessTimes(GetCurrentProcess(), &ProcCreate, &ProcExit,
> &KernelTime,
> + &UserTime) == 0)
> + return;
>
> - // FILETIME's are # of 100 nanosecond ticks (1/10th of a microsecond)
> - user_time.seconds( UserTime / 10000000 );
> - user_time.nanoseconds( unsigned(UserTime % 10000000) * 100 );
> - sys_time.seconds( KernelTime / 10000000 );
> - sys_time.nanoseconds( unsigned(KernelTime % 10000000) * 100 );
> + user_time = getTimeValueFromFILETIME(UserTime);
> + sys_time = getTimeValueFromFILETIME(SystemTime);
> }
>
>
I think you meant KernelTime instead of SystemTime.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130104/bd507c95/attachment.html>
More information about the llvm-commits
mailing list