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

Unified Diff: runtime/platform/globals.h

Issue 191743002: Replace RoundMicrosecondsTo* utility. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
===================================================================
--- runtime/platform/globals.h (revision 33466)
+++ runtime/platform/globals.h (working copy)
@@ -326,13 +326,13 @@
kMicrosecondsPerSecond);
// Helpers to round micro second times to human understandable values.
-inline double RoundMicrosecondsToSeconds(int64_t micros) {
+inline int64_t RoundMicrosecondsToSeconds(int64_t micros) {
Ivan Posva 2014/03/10 13:00:36 We should keep these as double and drop the roundi
const int k1M = 1000000; // Converting us to secs.
- return static_cast<double>(micros + (k1M >> 1)) / k1M;
+ return (micros + (k1M >> 1)) / k1M;
}
-inline double RoundMicrosecondsToMilliseconds(int64_t micros) {
- const int k1K = 1000; // Conversting us to ms.
- return static_cast<double>(micros + (k1K >> 1)) / k1K;
+inline int64_t RoundMicrosecondsToMilliseconds(int64_t micros) {
Ivan Posva 2014/03/10 13:00:36 ditto.
+ const int k1K = 1000; // Converting us to ms.
+ return (micros + (k1K >> 1)) / k1K;
}
// A macro to disallow the copy constructor and operator= functions.
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698