diff options
author | Cary Coutant <ccoutant@google.com> | 2011-10-18 00:06:10 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-10-18 00:06:10 +0000 |
commit | b490c0bbaf81fb741c6751eff30082883343e2ff (patch) | |
tree | fbfdd4a8a314245629467b77cc7fa4203fac6a23 /gold/timer.h | |
parent | 41835e6a39b581ab4f7fba25e02aba01e50a8521 (diff) | |
download | binutils-b490c0bbaf81fb741c6751eff30082883343e2ff.zip binutils-b490c0bbaf81fb741c6751eff30082883343e2ff.tar.gz binutils-b490c0bbaf81fb741c6751eff30082883343e2ff.tar.bz2 |
* 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.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/timer.h b/gold/timer.h index 50b55e4..4f986ca 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]; }; } |