blob: 7ec2b395485e14ead4fde4e7dff1f394a9b2ccb1 [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//
10// This file provides the Win32 specific implementation of the TimeValue class.
11//
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
33// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
34
35}