X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flib%2Fbuilder.cpp;h=3379f2dcfebdea1e1f0d4533189d4480f71ba7ed;hb=3c07e3725d6a4f002cb3e246cf707ffda73f9a96;hp=08e9cd7ef69f68b8d12d2bb61c081d3145db789e;hpb=52719526cc36271872280b987c7bf2393073f98b;p=builder.git diff --git a/source/lib/builder.cpp b/source/lib/builder.cpp index 08e9cd7..3379f2d 100644 --- a/source/lib/builder.cpp +++ b/source/lib/builder.cpp @@ -282,6 +282,7 @@ void Builder::save_caches() int Builder::build(unsigned jobs, bool dry_run, bool show_progress) { unsigned total = build_graph.count_rebuild_targets(); + Time::TimeStamp start_time = Time::now(); if(!total) { @@ -293,6 +294,7 @@ int Builder::build(unsigned jobs, bool dry_run, bool show_progress) vector tasks; unsigned count = 0; + Time::TimeDelta sum_time; bool fail = false; bool finish = false; @@ -350,6 +352,13 @@ int Builder::build(unsigned jobs, bool dry_run, bool show_progress) { ++count; + const vector &targets = tasks[i]->get_targets(); + if(!targets.empty()) + { + sum_time += tasks[i]->get_duration(); + get_logger().log("timings", "%s built in %s", targets.front()->get_name(), tasks[i]->get_duration()); + } + delete tasks[i]; tasks.erase(tasks.begin()+i); if(status==Task::ERROR) @@ -370,6 +379,9 @@ int Builder::build(unsigned jobs, bool dry_run, bool show_progress) else if(show_progress) get_logger().log("summary", "Build complete"); + Time::TimeStamp end_time = Time::now(); + get_logger().log("timings", "Build took %s, with a total %s spent on tasks", end_time-start_time, sum_time); + return fail; }