| 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;
|
|
|