diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-15 04:36:35 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-15 04:36:35 +0000 |
commit | bfb7b3eb6822e790b660ce2b4410e777963636c2 (patch) | |
tree | 1586536d96d5c3fab405ea0f435990993871d2f0 /llvm/lib/System/SunOS/TimeValue.cpp | |
parent | cbd9aeb5876b97711910f5450bb30e5fca79cc56 (diff) | |
download | bcm5719-llvm-bfb7b3eb6822e790b660ce2b4410e777963636c2.tar.gz bcm5719-llvm-bfb7b3eb6822e790b660ce2b4410e777963636c2.zip |
Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.
llvm-svn: 17813
Diffstat (limited to 'llvm/lib/System/SunOS/TimeValue.cpp')
-rw-r--r-- | llvm/lib/System/SunOS/TimeValue.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/llvm/lib/System/SunOS/TimeValue.cpp b/llvm/lib/System/SunOS/TimeValue.cpp index 8f44060f475..7e47331b3f6 100644 --- a/llvm/lib/System/SunOS/TimeValue.cpp +++ b/llvm/lib/System/SunOS/TimeValue.cpp @@ -12,8 +12,7 @@ //===----------------------------------------------------------------------===// // Include the generic Unix implementation -#include "../Unix/Unix.h" -#include <sys/time.h> +#include "../Unix/Unix.cpp" namespace llvm { using namespace sys; @@ -23,18 +22,6 @@ using namespace sys; //=== and must not be generic UNIX code (see ../Unix/TimeValue.cpp) //===----------------------------------------------------------------------===// -TimeValue TimeValue::now() { - struct timeval the_time; - timerclear(&the_time); - if (0 != ::gettimeofday(&the_time,0)) - ThrowErrno("Couldn't obtain time of day"); - - return TimeValue( - static_cast<TimeValue::SecondsType>( the_time.tv_sec ), - static_cast<TimeValue::NanoSecondsType>( the_time.tv_usec * - NANOSECONDS_PER_MICROSECOND ) ); -} - // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab } |