ninja-build / ninja

a small build system with a focus on speed
https://ninja-build.org/
Apache License 2.0
11.18k stars 1.59k forks source link

Feature request -- print elapsed time #267

Open ramosian-glider opened 12 years ago

ramosian-glider commented 12 years ago

Ninja is so fast that I always run it under the time command to see how fast it actually is. Can ninja please print the time it's been working for itself?

evmar commented 12 years ago

You can use "-t stats" to print some timing information.

But "time ninja" will always be a more accurate time measurement, because it takes some time for the kernel to load the binary and ld.so to load libc etc. which all happen before ninja could start measuring its own time.

AoD314 commented 10 years ago

https://github.com/martine/ninja/pull/749

Hi-Angel commented 1 year ago

You can use "-t stats" to print some timing information.

There does not seem to be such a tool. It says a unknown tool 'stats', and doing a ninja -t list does not show anything that would seem to be statistics-related.

UPD: there seems to be an issue about statistics, so I would presume such tool definitely does not exist.

kiwixz commented 1 year ago

The flag you are looking for is -d stats.

$ ninja -d stats
ninja: no work to do.
metric              count   avg (us)    total (ms)
.ninja parse        1       438.0       0.4
.ninja_log load     1       193.0       0.2
.ninja_deps load    1       1585.0      1.6
node stat           1078    2.4         2.6
node stat           1078    2.3         2.5

path->node hash load 0.99 (1102 entries / 1109 buckets)