LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Win32/TimeValue.cpp

Go to the documentation of this file.
00001 //===- Win32/TimeValue.cpp - Win32 TimeValue Implementation -----*- C++ -*-===//
00002 // 
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by Jeff Cohen and is distributed under the 
00006 // University of Illinois Open Source License. See LICENSE.TXT for details.
00007 // 
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file provides the Win32 implementation of the TimeValue class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "Win32.h"
00015 
00016 namespace llvm {
00017 using namespace sys;
00018 
00019 //===----------------------------------------------------------------------===//
00020 //=== WARNING: Implementation here must contain only Win32 specific code.
00021 //===----------------------------------------------------------------------===//
00022 
00023 TimeValue TimeValue::now() {
00024   __int64 ft;
00025   GetSystemTimeAsFileTime(reinterpret_cast<FILETIME *>(&ft));
00026 
00027   return TimeValue(
00028     static_cast<TimeValue::SecondsType>( ft / 10000000 +
00029       Win32ZeroTime.seconds_ ),
00030     static_cast<TimeValue::NanoSecondsType>( (ft % 10000000) * 100) );
00031 }
00032 
00033 std::string TimeValue::toString() const {
00034   return "Don't know how to conver time on Win32";
00035 }
00036 
00037 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
00038 
00039 }