Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Unified Diff: runtime/bin/utils_win.cc

Issue 1800863002: Cleanup in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/utils_win.h ('k') | runtime/bin/vmservice_dartium.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/utils_win.cc
diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc
index 227cc243c19cabe103bc3ae8cbcc67465a69bd70..7e3cfb689a7caf953365ca083faf72e9569070d5 100644
--- a/runtime/bin/utils_win.cc
+++ b/runtime/bin/utils_win.cc
@@ -8,12 +8,11 @@
#include <errno.h> // NOLINT
#include <time.h> // NOLINT
+#include "bin/log.h"
#include "bin/utils.h"
#include "bin/utils_win.h"
-#include "bin/log.h"
#include "platform/assert.h"
-
namespace dart {
namespace bin {
@@ -185,20 +184,22 @@ bool ShellUtils::GetUtf8Argv(int argc, char** argv) {
}
+// Although win32 uses 64-bit integers for representing timestamps,
+// these are packed into a FILETIME structure. The FILETIME
+// structure is just a struct representing a 64-bit integer. The
+// TimeStamp union allows access to both a FILETIME and an integer
+// representation of the timestamp. The Windows timestamp is in
+// 100-nanosecond intervals since January 1, 1601.
+union TimeStamp {
+ FILETIME ft_;
+ int64_t t_;
+};
+
+
static int64_t GetCurrentTimeMicros() {
static const int64_t kTimeEpoc = 116444736000000000LL;
static const int64_t kTimeScaler = 10; // 100 ns to us.
- // Although win32 uses 64-bit integers for representing timestamps,
- // these are packed into a FILETIME structure. The FILETIME
- // structure is just a struct representing a 64-bit integer. The
- // TimeStamp union allows access to both a FILETIME and an integer
- // representation of the timestamp. The Windows timestamp is in
- // 100-nanosecond intervals since January 1, 1601.
- union TimeStamp {
- FILETIME ft_;
- int64_t t_;
- };
TimeStamp time;
GetSystemTimeAsFileTime(&time.ft_);
return (time.t_ - kTimeEpoc) / kTimeScaler;
« no previous file with comments | « runtime/bin/utils_win.h ('k') | runtime/bin/vmservice_dartium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698