diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2004-09-28 23:56:20 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2004-09-28 23:56:20 +0000 |
| commit | 364cce404a87fcf60626696457f8dffca23f0172 (patch) | |
| tree | 0e4b91d59b0a6a8930d1d0f2451b5c1526e62400 /llvm/lib/System | |
| parent | 5d98fe9ef8059a14c090fb9fa22cc93bf0b60556 (diff) | |
| download | bcm5719-llvm-364cce404a87fcf60626696457f8dffca23f0172.tar.gz bcm5719-llvm-364cce404a87fcf60626696457f8dffca23f0172.zip | |
Win32 implementation of TimeValue::now().
Patch contributed by Jeff Cohen. Thanks Jeff!
llvm-svn: 16563
Diffstat (limited to 'llvm/lib/System')
| -rw-r--r-- | llvm/lib/System/Win32/TimeValue.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/System/Win32/TimeValue.cpp b/llvm/lib/System/Win32/TimeValue.cpp index c9c3220fc83..7ec2b395485 100644 --- a/llvm/lib/System/Win32/TimeValue.cpp +++ b/llvm/lib/System/Win32/TimeValue.cpp @@ -2,7 +2,7 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Jeff Cohen and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// @@ -11,18 +11,24 @@ // //===----------------------------------------------------------------------===// -// Include the generic Unix implementation -#include "../Unix/Unix.h" +#include "Win32.h" namespace llvm { using namespace sys; //===----------------------------------------------------------------------===// -//=== WARNING: Implementation here must contain only Win32 specific code -//=== and must not be generic UNIX code (see ../Unix/TimeValue.cpp) +//=== WARNING: Implementation here must contain only Win32 specific code. //===----------------------------------------------------------------------===// -// FIXME: Need TimeValue::now() +TimeValue TimeValue::now() { + __int64 ft; + GetSystemTimeAsFileTime(reinterpret_cast<FILETIME *>(&ft)); + + return TimeValue( + static_cast<TimeValue::SecondsType>( ft / 10000000 + + Win32ZeroTime.seconds_ ), + static_cast<TimeValue::NanoSecondsType>( (ft % 10000000) * 100) ); +} // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab |

