20 #include "../exception.h"
34 running.emplace_back(track, std::chrono::system_clock::now());
39 std::chrono::system_clock::time_point endTime(std::chrono::system_clock::now());
44 track.
min = track.
max = track.
sum = sample;
60 typedef std::pair<std::string, time_t> Entry;
61 std::vector<Entry> idx;
62 idx.reserve(
tracks.size());
64 for (
const auto& _ :
tracks) {
65 idx.emplace_back(_.first, _.second.n == 0 ? 0 : (_.second.sum / _.second.n));
66 maxlen =
std::max(_.first.size(), maxlen);
68 std::sort(idx.begin(), idx.end(), [&](Entry& _1, Entry& _2) { return _1.second < _2.second; });
69 stream <<
"=== " <<
total <<
" us" << std::endl;
72 << std::setw(maxlen) <<
"<id>"
81 << std::setw(maxlen) << _.first
82 <<
"\t" << (track.
n == 0 ? 0 : (track.
sum / track.
n))
93 << std::setw(maxlen) << _.first
94 <<
"\t" << (track.
n == 0 ? 0 : (track.
sum / track.
n))
std::map< std::string, Track > tracks
void operator()(const std::string &track)
void report(std::ostream &, ReportType type=ReportType::FULL) const
std::vector< std::pair< std::string, std::chrono::system_clock::time_point > > running
#define BEATMUP_ASSERT_DEBUG(C)
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
JNIEnv jlong jint jint count