Lines Matching refs:Timer
1 //===-- llvm/Support/Timer.h - Interval Timing Support ----------*- C++ -*-===//
22 class Timer;
70 /// Timer - This class is used to track the amount of time spent between
73 /// By default, the Timer will print the amount of time it has captured to
74 /// standard error when the last timer is destroyed, otherwise it is printed
78 class Timer {
82 bool Running; // Is the timer currently running?
83 bool Triggered; // Has the timer ever been triggered?
84 TimerGroup *TG; // The TimerGroup this Timer is in.
86 Timer **Prev, *Next; // Doubly linked list of timers in the group.
88 explicit Timer(StringRef N) : TG(nullptr) { init(N); }
89 Timer(StringRef N, TimerGroup &tg) : TG(nullptr) { init(N, tg); }
90 Timer(const Timer &RHS) : TG(nullptr) {
93 const Timer &operator=(const Timer &T) {
97 ~Timer();
99 // Create an uninitialized timer, client must use 'init'.
100 explicit Timer() : TG(nullptr) {}
107 /// Check if the timer is currently running.
110 /// Check if startTimer() has ever been called on this timer.
113 /// Start the timer running. Time between calls to startTimer/stopTimer is
114 /// counted by the Timer class. Note that these calls must be correctly
118 /// Stop the timer.
121 /// Clear the timer state.
124 /// Return the duration for which this timer has been running.
132 /// stopTimer() methods of the Timer class. When the object is constructed, it
133 /// starts the timer specified as its argument. When it is destroyed, it stops
134 /// the relevant timer. This makes it easy to time a region of code.
137 Timer *T;
141 explicit TimeRegion(Timer &t) : T(&t) {
144 explicit TimeRegion(Timer *t) : T(t) {
153 /// Timer. It allows you to declare a new timer, AND specify the region to
167 /// TimerGroup can be specified for a newly created timer in its constructor.
171 Timer *FirstTimer; // First timer in the group.
191 friend class Timer;
192 void addTimer(Timer &T);
193 void removeTimer(Timer &T);