Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b199dfd8 authored by Nandana Dutt's avatar Nandana Dutt Committed by android-build-merger
Browse files

Merge "dumpstate: allow printf the duration of command to bugreport"

am: 0be2047b

Change-Id: I72b31e3dbfb54eac7a11825db7bd09c79a07167e
parents 2c09b198 0be2047b
Loading
Loading
Loading
Loading
+5 −7
Original line number Original line Diff line number Diff line
@@ -2913,17 +2913,15 @@ DurationReporter::DurationReporter(const std::string& title, bool logcat_only, b
DurationReporter::~DurationReporter() {
DurationReporter::~DurationReporter() {
    if (!title_.empty()) {
    if (!title_.empty()) {
        float elapsed = (float)(Nanotime() - started_) / NANOS_PER_SEC;
        float elapsed = (float)(Nanotime() - started_) / NANOS_PER_SEC;
        if (elapsed < .5f && !verbose_) {
        if (elapsed >= .5f || verbose_) {
            return;
        }
            MYLOGD("Duration of '%s': %.2fs\n", title_.c_str(), elapsed);
            MYLOGD("Duration of '%s': %.2fs\n", title_.c_str(), elapsed);
        if (logcat_only_) {
            return;
        }
        }
        if (!logcat_only_) {
            // Use "Yoda grammar" to make it easier to grep|sort sections.
            // Use "Yoda grammar" to make it easier to grep|sort sections.
            printf("------ %.3fs was the duration of '%s' ------\n", elapsed, title_.c_str());
            printf("------ %.3fs was the duration of '%s' ------\n", elapsed, title_.c_str());
        }
        }
    }
    }
}


const int32_t Progress::kDefaultMax = 5000;
const int32_t Progress::kDefaultMax = 5000;