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

Unified Diff: bench/nanobench.cpp

Issue 599913002: Have nanobench --verbose mode always just print integer nanoseconds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More natural integration. Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 923a0df7b155996ab6d940d3f4ef13333cadd86a..21aeef4b3c263f57616b58fd2b7b41ae783376b6 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -72,12 +72,13 @@ DEFINE_string(scales, "1.0", "Space-separated scales for SKPs.");
DEFINE_bool(bbh, true, "Build a BBH for SKPs?");
static SkString humanize(double ms) {
- if (ms > 1e+3) return SkStringPrintf("%.3gs", ms/1e3);
- if (ms < 1e-3) return SkStringPrintf("%.3gns", ms*1e6);
+ if (FLAGS_verbose) return SkStringPrintf("%llu", (uint64_t)(ms*1e6));
+ if (ms > 1e+3) return SkStringPrintf("%.3gs", ms/1e3);
+ if (ms < 1e-3) return SkStringPrintf("%.3gns", ms*1e6);
#ifdef SK_BUILD_FOR_WIN
- if (ms < 1) return SkStringPrintf("%.3gus", ms*1e3);
+ if (ms < 1) return SkStringPrintf("%.3gus", ms*1e3);
#else
- if (ms < 1) return SkStringPrintf("%.3gµs", ms*1e3);
+ if (ms < 1) return SkStringPrintf("%.3gµs", ms*1e3);
#endif
return SkStringPrintf("%.3gms", ms);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698