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

Unified Diff: runtime/vm/os_android.cc

Issue 1367973004: Make timeline use the same clock source as mojo's tracing infrastructure (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/vm/os.h ('k') | runtime/vm/os_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_android.cc
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index 0966a52adca04a2fb88fb729cc1f2fc47d4f005d..1d448d0124487494f5fe580df552520e754ce803 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -179,6 +179,20 @@ int64_t OS::GetCurrentTimeMicros() {
}
+int64_t OS::GetCurrentTraceMicros() {
+ struct timespec ts;
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
+ UNREACHABLE();
+ return 0;
+ }
+ // Convert to microseconds.
+ int64_t result = ts.tv_sec;
+ result *= kMicrosecondsPerSecond;
+ result += (ts.tv_nsec / kNanosecondsPerMicrosecond);
+ return result;
+}
+
+
void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
const int kMinimumAlignment = 16;
ASSERT(Utils::IsPowerOfTwo(alignment));
« no previous file with comments | « runtime/vm/os.h ('k') | runtime/vm/os_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698