summaryrefslogtreecommitdiff
path: root/gold/timer.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-10-18 00:06:09 +0000
committerCary Coutant <ccoutant@google.com>2011-10-18 00:06:09 +0000
commit885dbbf6b54998b0c0afdd9f5aae7b8edd3782ff (patch)
treec658708b4b292d926220a12bfa3b94bf8704fec5 /gold/timer.h
parentb5f101e46943bf5ef86f242d40d54be7615400d0 (diff)
downloadbinutils-redhat-885dbbf6b54998b0c0afdd9f5aae7b8edd3782ff.tar.gz
* gold.cc: Include timer.h.
(queue_middle_tasks): Stamp time. (queue_final_tasks): Likewise. * main.cc (main): Store timer in parameters. Print timers for each pass. * parameters.cc (Parameters::Parameters): Initialize timer_. (Parameters::set_timer): New function. (set_parameters_timer): New function. * parameters.h (Parameters::set_timer): New function. (Parameters::timer): New function. (Parameters::timer_): New data member. (set_parameters_timer): New function. * timer.cc (Timer::stamp): New function. (Timer::get_pass_time): New function. * timer.h (Timer::stamp): New function. (Timer::get_pass_time): New function. (Timer::pass_times_): New data member.
Diffstat (limited to 'gold/timer.h')
-rw-r--r--gold/timer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/timer.h b/gold/timer.h
index 50b55e49dd..4f986ca11e 100644
--- a/gold/timer.h
+++ b/gold/timer.h
@@ -48,10 +48,18 @@ class Timer
TimeStats
get_elapsed_time();
+ // Return the stats for pass N (0 <= N <= 2).
+ TimeStats
+ get_pass_time(int n);
+
// Start counting the time.
void
start();
+ // Record the time used by pass N (0 <= N <= 2).
+ void
+ stamp(int n);
+
private:
// This class cannot be copied.
Timer(const Timer&);
@@ -63,6 +71,9 @@ class Timer
// The time of the last call to start.
TimeStats start_time_;
+
+ // Times for each pass.
+ TimeStats pass_times_[3];
};
}