2004-09-25 05:03:54 +00:00
|
|
|
//===- Win32/TimeValue.cpp - Win32 TimeValue Implementation -----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2004-09-28 23:56:20 +00:00
|
|
|
// This file was developed by Jeff Cohen and is distributed under the
|
2004-09-25 05:03:54 +00:00
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file provides the Win32 specific implementation of the TimeValue class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-28 23:56:20 +00:00
|
|
|
#include "Win32.h"
|
2004-09-25 05:03:54 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
using namespace sys;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2004-09-28 23:56:20 +00:00
|
|
|
//=== WARNING: Implementation here must contain only Win32 specific code.
|
2004-09-25 05:03:54 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-28 23:56:20 +00:00
|
|
|
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) );
|
|
|
|
}
|
2004-09-25 05:03:54 +00:00
|
|
|
|
|
|
|
// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
|
|
|
|
|
|
|
|
}
|