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

Side by Side Diff: tools/Stats.h

Issue 393673006: Give windows boring bars and use 'us' for microseconds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: us too Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « bench/nanobench.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef Stats_DEFINED 1 #ifndef Stats_DEFINED
2 #define Stats_DEFINED 2 #define Stats_DEFINED
3 3
4 #include <math.h> 4 #include <math.h>
5 5
6 #include "SkString.h" 6 #include "SkString.h"
7 #include "SkTSort.h" 7 #include "SkTSort.h"
8 8
9 static const char* kBars[] = { "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" }; 9 #ifdef SK_BUILD_FOR_WIN
10 static const char* kBars[] = { ".", "o", "O" };
11 #else
12 static const char* kBars[] = { "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" };
13 #endif
10 14
11 struct Stats { 15 struct Stats {
12 Stats(const double samples[], int n) { 16 Stats(const double samples[], int n) {
13 min = samples[0]; 17 min = samples[0];
14 max = samples[0]; 18 max = samples[0];
15 for (int i = 0; i < n; i++) { 19 for (int i = 0; i < n; i++) {
16 if (samples[i] < min) { min = samples[i]; } 20 if (samples[i] < min) { min = samples[i]; }
17 if (samples[i] > max) { max = samples[i]; } 21 if (samples[i] > max) { max = samples[i]; }
18 } 22 }
19 23
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 58
55 double min; 59 double min;
56 double max; 60 double max;
57 double mean; // Estimate of population mean. 61 double mean; // Estimate of population mean.
58 double var; // Estimate of population variance. 62 double var; // Estimate of population variance.
59 double median; 63 double median;
60 SkString plot; // A single-line bar chart (_not_ histogram) of the samples. 64 SkString plot; // A single-line bar chart (_not_ histogram) of the samples.
61 }; 65 };
62 66
63 #endif//Stats_DEFINED 67 #endif//Stats_DEFINED
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698