Confirmed users
398
edits
(/* Labels) |
(/* Labels) |
||
| Line 119: | Line 119: | ||
For the case of labeling at begin and end of a scope, |AutoScopedLabel| is a helper class to do that. | For the case of labeling at begin and end of a scope, |AutoScopedLabel| is a helper class to do that. | ||
{ | |||
#ifdef MOZ_TASK_TRACER | #ifdef MOZ_TASK_TRACER | ||
AutoScopedLabel label("Event [%s] ...", str...); // label "Begin Event [...]..." | AutoScopedLabel label("Event [%s] ...", str...); // label "Begin Event [...]..." | ||
#endif | |||
// do something .... | // do something .... | ||
} // label "End Event [...]..." | } // label "End Event [...]..." | ||
The "Begin ..." label would be added when the instance of |AutoScopedLabel| was created. And, "End ..." label would be added when the instance was destroyed. | The "Begin ..." label would be added when the instance of |AutoScopedLabel| was created. And, "End ..." label would be added when the instance was destroyed. | ||