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

Unified Diff: src/platform-posix.cc

Issue 23710002: Revert "Cross-compiling from Linux to Android requires -lrt for the host toolset.", "Fix Visual Stu… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index dd6b77c265464f1c62c3e7c391db8bc5d8514737..58d0a2478dbf564effd2b81403fd5455ce262c52 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -313,7 +313,19 @@ int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
double OS::TimeCurrentMillis() {
- return Time::Now().ToJsTime();
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) < 0) return 0.0;
+ return (static_cast<double>(tv.tv_sec) * 1000) +
+ (static_cast<double>(tv.tv_usec) / 1000);
+}
+
+
+int64_t OS::Ticks() {
+ // gettimeofday has microsecond resolution.
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) < 0)
+ return 0;
+ return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
}
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698