OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_OS_FUCHSIA) | 6 #if defined(TARGET_OS_FUCHSIA) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> | 10 #include <errno.h> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 return static_cast<int>(-timezone); | 68 return static_cast<int>(-timezone); |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 int64_t OS::GetCurrentTimeMillis() { | 72 int64_t OS::GetCurrentTimeMillis() { |
73 return GetCurrentTimeMicros() / 1000; | 73 return GetCurrentTimeMicros() / 1000; |
74 } | 74 } |
75 | 75 |
76 | 76 |
77 int64_t OS::GetCurrentTimeMicros() { | 77 int64_t OS::GetCurrentTimeMicros() { |
78 return mx_current_time() / 1000; | 78 return mx_time_get(MX_CLOCK_MONOTONIC) / 1000; |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 int64_t OS::GetCurrentMonotonicTicks() { | 82 int64_t OS::GetCurrentMonotonicTicks() { |
83 return mx_current_time(); | 83 return mx_time_get(MX_CLOCK_MONOTONIC); |
84 } | 84 } |
85 | 85 |
86 | 86 |
87 int64_t OS::GetCurrentMonotonicFrequency() { | 87 int64_t OS::GetCurrentMonotonicFrequency() { |
88 return kNanosecondsPerSecond; | 88 return kNanosecondsPerSecond; |
89 } | 89 } |
90 | 90 |
91 | 91 |
92 int64_t OS::GetCurrentMonotonicMicros() { | 92 int64_t OS::GetCurrentMonotonicMicros() { |
93 int64_t ticks = GetCurrentMonotonicTicks(); | 93 int64_t ticks = GetCurrentMonotonicTicks(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 309 } |
310 | 310 |
311 | 311 |
312 void OS::Exit(int code) { | 312 void OS::Exit(int code) { |
313 UNIMPLEMENTED(); | 313 UNIMPLEMENTED(); |
314 } | 314 } |
315 | 315 |
316 } // namespace dart | 316 } // namespace dart |
317 | 317 |
318 #endif // defined(TARGET_OS_FUCHSIA) | 318 #endif // defined(TARGET_OS_FUCHSIA) |
OLD | NEW |