diff options
-rw-r--r-- | src/build.cc | 8 | ||||
-rw-r--r-- | src/build.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/build.cc b/src/build.cc index 701fa92..2f5b267 100644 --- a/src/build.cc +++ b/src/build.cc @@ -238,6 +238,14 @@ string BuildStatus::FormatProgressStatus( out += buf; break; + case 'e': + { + double elapsed = overall_rate_.Elapsed(); + snprintf(buf, sizeof(buf), "%.3fs", elapsed); + out += buf; + break; + } + default: Fatal("unknown placeholder '%%%c' in $NINJA_STATUS", *s); return ""; diff --git a/src/build.h b/src/build.h index 23f653e..5747170 100644 --- a/src/build.h +++ b/src/build.h @@ -220,6 +220,7 @@ struct BuildStatus { RateInfo() : rate_(-1) {} void Restart() { stopwatch_.Restart(); } + double Elapsed() const { return stopwatch_.Elapsed(); } double rate() { return rate_; } void UpdateRate(int edges) { |