[llvm-commits] CVS: llvm/lib/System/Linux/TimeValue.cpp

Reid Spencer reid at x10sys.com
Sun Nov 14 20:37:22 PST 2004



Changes in directory llvm/lib/System/Linux:

TimeValue.cpp updated: 1.4 -> 1.5
---
Log message:

Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.


---
Diffs of the changes:  (+0 -13)

Index: llvm/lib/System/Linux/TimeValue.cpp
diff -u llvm/lib/System/Linux/TimeValue.cpp:1.4 llvm/lib/System/Linux/TimeValue.cpp:1.5
--- llvm/lib/System/Linux/TimeValue.cpp:1.4	Sun Nov 14 16:07:04 2004
+++ llvm/lib/System/Linux/TimeValue.cpp	Sun Nov 14 22:36:34 2004
@@ -14,8 +14,6 @@
 // Include the generic Unix implementation
 #include "../Unix/TimeValue.cpp"
 
-#include <sys/time.h>
-
 namespace llvm {
 
 using namespace sys;
@@ -25,17 +23,6 @@
 //===          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
 
 }






More information about the llvm-commits mailing list