Loading cmds/dumpstate/utils.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -102,14 +102,16 @@ DurationReporter::DurationReporter(const std::string& title, bool logcat_only) DurationReporter::~DurationReporter() { if (!title_.empty()) { uint64_t elapsed = Nanotime() - started_; MYLOGD("Duration of '%s': %.3fs\n", title_.c_str(), (float)elapsed / NANOS_PER_SEC); float elapsed = (float)(Nanotime() - started_) / NANOS_PER_SEC; if (elapsed < .5f) { return; } MYLOGD("Duration of '%s': %.2fs\n", title_.c_str(), elapsed); if (logcat_only_) { return; } // Use "Yoda grammar" to make it easier to grep|sort sections. printf("------ %.3fs was the duration of '%s' ------\n", (float)elapsed / NANOS_PER_SEC, title_.c_str()); printf("------ %.3fs was the duration of '%s' ------\n", elapsed, title_.c_str()); } } Loading Loading
cmds/dumpstate/utils.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -102,14 +102,16 @@ DurationReporter::DurationReporter(const std::string& title, bool logcat_only) DurationReporter::~DurationReporter() { if (!title_.empty()) { uint64_t elapsed = Nanotime() - started_; MYLOGD("Duration of '%s': %.3fs\n", title_.c_str(), (float)elapsed / NANOS_PER_SEC); float elapsed = (float)(Nanotime() - started_) / NANOS_PER_SEC; if (elapsed < .5f) { return; } MYLOGD("Duration of '%s': %.2fs\n", title_.c_str(), elapsed); if (logcat_only_) { return; } // Use "Yoda grammar" to make it easier to grep|sort sections. printf("------ %.3fs was the duration of '%s' ------\n", (float)elapsed / NANOS_PER_SEC, title_.c_str()); printf("------ %.3fs was the duration of '%s' ------\n", elapsed, title_.c_str()); } } Loading