From 00b5df427f11e8ae703d618f11f6b175e5b7d45b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 15 Nov 2004 04:36:35 +0000 Subject: Consolidate the implementation of TimeValue::now() for Unix to use the seemingly ubiquitous gettimeofday(3) call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17813 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/FreeBSD/TimeValue.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'lib/System/FreeBSD/TimeValue.cpp') diff --git a/lib/System/FreeBSD/TimeValue.cpp b/lib/System/FreeBSD/TimeValue.cpp index 79ed9a8633..bade838777 100644 --- a/lib/System/FreeBSD/TimeValue.cpp +++ b/lib/System/FreeBSD/TimeValue.cpp @@ -12,8 +12,7 @@ //===----------------------------------------------------------------------===// // Include the generic Unix implementation -#include "../Unix/Unix.h" -#include +#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( the_time.tv_sec + - PosixZeroTime.seconds_ ), - static_cast( the_time.tv_usec * - NANOSECONDS_PER_MICROSECOND ) ); -} // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab } -- cgit v1.2.3-18-g5258