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

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 33491)
+++ runtime/platform/globals.h (working copy)
@@ -325,14 +325,12 @@
const int kNanosecondsPerSecond = (kNanosecondsPerMicrosecond *
kMicrosecondsPerSecond);
-// Helpers to round micro second times to human understandable values.
-inline double RoundMicrosecondsToSeconds(int64_t micros) {
- const int k1M = 1000000; // Converting us to secs.
- return static_cast<double>(micros + (k1M >> 1)) / k1M;
+// Helpers to scale micro second times to human understandable values.
+inline double MicrosecondsToSeconds(int64_t micros) {
+ return static_cast<double>(micros) / kMicrosecondsPerSecond;
}
-inline double RoundMicrosecondsToMilliseconds(int64_t micros) {
- const int k1K = 1000; // Conversting us to ms.
- return static_cast<double>(micros + (k1K >> 1)) / k1K;
+inline double MicrosecondsToMilliseconds(int64_t micros) {
+ return static_cast<double>(micros) / kMicrosecondsPerMillisecond;
}
// 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