32 std::vector<int> times;
34 int64_t kMaxTimeMillis = 5 * 1000;
37 const int kRuns = 100;
38 for (
int j = 0; j < kRuns; ++j) {
40 if (start >= base_time + kMaxTimeMillis)
43 const int kNumRepetitions = 2000;
44 for (
int count = kNumRepetitions; count > 0; --count) {
46 size_t input_len = ::strlen(input);
47 for (
size_t max_width = input_len; max_width > 0; --max_width) {
48 std::string str(input, input_len);
55 times.push_back(delta);
61 for (
size_t i = 0; i < times.size(); ++i) {
65 else if (times[i] > max)
69 printf(
"min %dms max %dms avg %.1fms\n", min, max, total / times.size());