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

Unified Diff: runtime/bin/utils_android.cc

Issue 12280004: Moved GetCurrentTime functions from bin/eventhandler to bin/utils. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « runtime/bin/utils.h ('k') | runtime/bin/utils_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/utils_android.cc
===================================================================
--- runtime/bin/utils_android.cc (revision 18591)
+++ runtime/bin/utils_android.cc (working copy)
@@ -4,6 +4,7 @@
#include <errno.h>
#include <netdb.h>
+#include <sys/time.h>
#include "bin/utils.h"
#include "platform/assert.h"
@@ -69,3 +70,16 @@
void ShellUtils::FreeUnicodeArgv(wchar_t** argv) {
}
+
+int64_t TimerUtils::GetCurrentTimeMilliseconds() {
+ return GetCurrentTimeMicros() / 1000;
+}
+
+int64_t TimerUtils::GetCurrentTimeMicros() {
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) < 0) {
+ UNREACHABLE();
+ return 0;
+ }
+ return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
+}
« no previous file with comments | « runtime/bin/utils.h ('k') | runtime/bin/utils_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698