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

Unified Diff: runtime/platform/platform_os_macos.cc

Issue 13641005: Add a sleep function to dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: runtime/platform/platform_os_macos.cc
diff --git a/runtime/platform/platform_os_macos.cc b/runtime/platform/platform_os_macos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ef25cc6063395b0b872674d6741d99706b75671e
--- /dev/null
+++ b/runtime/platform/platform_os_macos.cc
@@ -0,0 +1,21 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_MACOS)
+
+#include "platform/platform_os.h"
+
+#include <unistd.h> // NOLINT
+
+namespace platform {
+
+void OS::Sleep(int64_t millis) {
+ // TODO(5411554): For now just use usleep we may have to revisit this.
+ usleep(millis * 1000);
+}
+
+} // namespace platform
+
+#endif // defined(TARGET_OS_MACOS)

Powered by Google App Engine
This is Rietveld 408576698