blob: eab776fc17fd52e88d5d3365ca83f3c8051f1513 [file] [log] [blame]
Reid Spencer0d5716e2004-09-25 05:03:54 +00001//===- Win32/TimeValue.cpp - Win32 TimeValue Implementation -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Reid Spencer10366a42004-09-28 23:56:20 +00005// This file was developed by Jeff Cohen and is distributed under the
Reid Spencer0d5716e2004-09-25 05:03:54 +00006// University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
Reid Spencera79a99a2004-11-15 04:47:22 +000010// This file provides the Win32 implementation of the TimeValue class.
Reid Spencer0d5716e2004-09-25 05:03:54 +000011//
12//===----------------------------------------------------------------------===//
13
Reid Spencer10366a42004-09-28 23:56:20 +000014#include "Win32.h"
Reid Spencer0d5716e2004-09-25 05:03:54 +000015
16namespace llvm {
17using namespace sys;
18
19//===----------------------------------------------------------------------===//
Reid Spencer10366a42004-09-28 23:56:20 +000020//=== WARNING: Implementation here must contain only Win32 specific code.
Reid Spencer0d5716e2004-09-25 05:03:54 +000021//===----------------------------------------------------------------------===//
22
Reid Spencer10366a42004-09-28 23:56:20 +000023TimeValue TimeValue::now() {
24 __int64 ft;
25 GetSystemTimeAsFileTime(reinterpret_cast<FILETIME *>(&ft));
26
27 return TimeValue(
28 static_cast<TimeValue::SecondsType>( ft / 10000000 +
29 Win32ZeroTime.seconds_ ),
30 static_cast<TimeValue::NanoSecondsType>( (ft % 10000000) * 100) );
31}
Reid Spencer0d5716e2004-09-25 05:03:54 +000032
Reid Spencer8bf7fba2004-11-16 06:22:17 +000033std::string TimeValue::toString() const {
34 return "Don't know how to conver time on Win32";
35}
36
Reid Spencer0d5716e2004-09-25 05:03:54 +000037// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
38
39}