www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
PerfGuard Class Reference

Scope guard for starting and stopping timing for a node. More...

#include <PerfGuard.h>

Public Member Functions

 PerfGuard (PerfGraph &graph, const PerfID id)
 Start timing for the given ID. More...
 
 ~PerfGuard ()
 Stop timing. More...
 

Protected Attributes

PerfGraph_graph
 The graph we're working on. More...
 

Detailed Description

Scope guard for starting and stopping timing for a node.

Note that the PerfGuard timing itself will take approximately 0.00015 milliseconds.

That might not sound very long - but you still don't want that in the inside of tiny loops

Definition at line 25 of file PerfGuard.h.

Constructor & Destructor Documentation

◆ PerfGuard()

PerfGuard::PerfGuard ( PerfGraph graph,
const PerfID  id 
)
inline

Start timing for the given ID.

Parameters
graphThe graph to add time into
idThe unique id of the section

Definition at line 34 of file PerfGuard.h.

34 : _graph(graph) { _graph.push(id); }
PerfGraph & _graph
The graph we&#39;re working on.
Definition: PerfGuard.h:43
void push(const PerfID id)
Add a Node onto the end of the end of the current callstack.
Definition: PerfGraph.C:120

◆ ~PerfGuard()

PerfGuard::~PerfGuard ( )
inline

Stop timing.

Definition at line 39 of file PerfGuard.h.

39 { _graph.pop(); }
void pop()
Remove a Node from the end of the current scope.
Definition: PerfGraph.C:142
PerfGraph & _graph
The graph we&#39;re working on.
Definition: PerfGuard.h:43

Member Data Documentation

◆ _graph

PerfGraph& PerfGuard::_graph
protected

The graph we're working on.

Definition at line 43 of file PerfGuard.h.

Referenced by PerfGuard(), and ~PerfGuard().


The documentation for this class was generated from the following file: