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

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

Issue 2822833002: [fuchsia] Use new mx_deadline_after interface (Closed)
Patch Set: [fuchsia] Use new mx_deadline_after interface Created 3 years, 8 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 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(HOST_OS_FUCHSIA) 6 #if defined(HOST_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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 92
93 int64_t TimerUtils::GetCurrentMonotonicMicros() { 93 int64_t TimerUtils::GetCurrentMonotonicMicros() {
94 int64_t ticks = mx_time_get(MX_CLOCK_MONOTONIC); 94 int64_t ticks = mx_time_get(MX_CLOCK_MONOTONIC);
95 return ticks / kNanosecondsPerMicrosecond; 95 return ticks / kNanosecondsPerMicrosecond;
96 } 96 }
97 97
98 98
99 void TimerUtils::Sleep(int64_t millis) { 99 void TimerUtils::Sleep(int64_t millis) {
100 mx_nanosleep(millis * kMicrosecondsPerMillisecond * 100 mx_nanosleep(mx_deadline_after(
101 kNanosecondsPerMicrosecond); 101 millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond));
102 } 102 }
103 103
104 } // namespace bin 104 } // namespace bin
105 } // namespace dart 105 } // namespace dart
106 106
107 #endif // defined(HOST_OS_FUCHSIA) 107 #endif // defined(HOST_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