[llvm-commits] CVS: llvm/lib/System/Unix/Process.cpp
Reid Spencer
reid at x10sys.com
Mon Dec 20 13:43:44 PST 2004
Changes in directory llvm/lib/System/Unix:
Process.cpp updated: 1.4 -> 1.5
---
Log message:
Implement GetTimeUsage correctly.
---
Diffs of the changes: (+8 -4)
Index: llvm/lib/System/Unix/Process.cpp
diff -u llvm/lib/System/Unix/Process.cpp:1.4 llvm/lib/System/Unix/Process.cpp:1.5
--- llvm/lib/System/Unix/Process.cpp:1.4 Mon Dec 20 10:33:37 2004
+++ llvm/lib/System/Unix/Process.cpp Mon Dec 20 15:43:33 2004
@@ -92,10 +92,14 @@
#if defined(HAVE_GETRUSAGE)
struct rusage usage;
::getrusage(RUSAGE_SELF, &usage);
- user_time.seconds( usage.ru_utime.tv_sec );
- user_time.microseconds( usage.ru_utime.tv_usec );
- sys_time.seconds( usage.ru_stime.tv_sec );
- sys_time.microseconds( usage.ru_stime.tv_usec );
+ user_time = TimeValue(
+ static_cast<TimeValue::SecondsType>( usage.ru_utime.tv_sec ),
+ static_cast<TimeValue::NanoSecondsType>( usage.ru_utime.tv_usec *
+ TimeValue::NANOSECONDS_PER_MICROSECOND ) );
+ sys_time = TimeValue(
+ static_cast<TimeValue::SecondsType>( usage.ru_stime.tv_sec ),
+ static_cast<TimeValue::NanoSecondsType>( usage.ru_stime.tv_usec *
+ TimeValue::NANOSECONDS_PER_MICROSECOND ) );
#else
#warning Cannot get usage times on this platform
user_time.seconds(0);
More information about the llvm-commits
mailing list