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

Side by Side Diff: runtime/bin/utils_fuchsia.cc

Issue 2466003002: Remove use of the deprecated mx_current_time Fuchsia syscall (Closed)
Patch Set: missed a spot Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_OS_FUCHSIA)
7 7
8 #include <errno.h> 8 #include <errno.h>
9 #include <magenta/syscalls.h> 9 #include <magenta/syscalls.h>
10 #include <magenta/types.h> 10 #include <magenta/types.h>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void TimerUtils::InitOnce() { 81 void TimerUtils::InitOnce() {
82 } 82 }
83 83
84 84
85 int64_t TimerUtils::GetCurrentMonotonicMillis() { 85 int64_t TimerUtils::GetCurrentMonotonicMillis() {
86 return GetCurrentMonotonicMicros() / 1000; 86 return GetCurrentMonotonicMicros() / 1000;
87 } 87 }
88 88
89 89
90 int64_t TimerUtils::GetCurrentMonotonicMicros() { 90 int64_t TimerUtils::GetCurrentMonotonicMicros() {
91 int64_t ticks = mx_current_time(); 91 int64_t ticks = mx_time_get(MX_CLOCK_MONOTONIC);
92 return ticks / kNanosecondsPerMicrosecond; 92 return ticks / kNanosecondsPerMicrosecond;
93 } 93 }
94 94
95 95
96 void TimerUtils::Sleep(int64_t millis) { 96 void TimerUtils::Sleep(int64_t millis) {
97 mx_nanosleep( 97 mx_nanosleep(
98 millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond); 98 millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond);
99 } 99 }
100 100
101 } // namespace bin 101 } // namespace bin
102 } // namespace dart 102 } // namespace dart
103 103
104 #endif // defined(TARGET_OS_FUCHSIA) 104 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698