Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::ScopedTimeLog Class Reference

Print the elapsed time since construction when destructed. More...

#include <ScopedTimeLog.hh>

Public Member Functions

 ScopedTimeLog (Logger *dest)
 Construct with a reference to a particular logger.
 
 ScopedTimeLog (double min_print_sec)
 Construct with a manual threshold for printing time.
 
 ScopedTimeLog (Logger *dest, double min_print_sec)
 Construct with a reference to a particular logger.
 
 ~ScopedTimeLog ()
 Print large enough times when exiting scope.
 
 CELER_DELETE_COPY_MOVE (ScopedTimeLog)
 

Detailed Description

Print the elapsed time since construction when destructed.

An optional construction argument specifies the minimum time needed to bother printing.

{
CELER_LOG(info) << "Doing something expensive";
ScopedTimeLog scoped_time;
do_something_expensive();
}
#define CELER_LOG(LEVEL)
Return a LogMessage object for streaming into at the given level.
Definition: corecel/io/Logger.hh:48

Member Function Documentation

◆ CELER_DELETE_COPY_MOVE()

celeritas::ScopedTimeLog::CELER_DELETE_COPY_MOVE ( ScopedTimeLog  )

Prevent copying and moving for RAII class


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