LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
timer.hxx
Go to the documentation of this file.
1 
6 #ifndef MISC_TIMER_HXX
7 # define MISC_TIMER_HXX
8 
9 # include <misc/timer.hh>
10 # include <misc/contract.hh>
11 
12 namespace misc
13 {
14 
15  inline
16  void
17  timer::push(int i)
18  {
19  precondition(this->intmap.find(i) != this->intmap.end());
20  this->push(this->intmap[i]);
21  }
22 
23  inline
24  void
25  timer::pop(const std::string& task_name)
26  {
27  (void) task_name;
28  precondition(this->tasksmap[task_name] == this->tasks.top());
29  this->pop();
30  }
31 
32  inline
33  void
34  timer::pop(int i)
35  {
36  this->pop(this->intmap[i]);
37  }
38 
39 
40  inline
41  void
42  timer::dump_on_destruction(std::ostream& out)
43  {
44  this->dump_stream = &out;
45  }
46 
47  inline
48  void
50  {
51  this->total.start();
52  }
53 
54  inline
55  void
57  {
58  this->total.stop();
59  }
60 
61  inline
63  : user(0), sys(0), wall(0)
64  {}
65 
66  inline
69  {
70  this->wall += rhs.wall;
71  this->user += rhs.user;
72  this->sys += rhs.sys;
73  return *this;
74  }
75 
76 } // namespace misc
77 
78 #endif // !MISC_TIMER_HXX