OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Member Functions | List of all members
InternalZGY::RawPrintingTimer Class Reference

Timer that prints its result when going out of scope. More...

#include <timer.h>

Inheritance diagram for InternalZGY::RawPrintingTimer:
InternalZGY::Timer

Public Member Functions

 RawPrintingTimer (const char *name, int level=1)
 
void print ()
 
- Public Member Functions inherited from InternalZGY::Timer
 Timer (bool enable=true, const char *name=0, int skip=0, bool startrunning=true)
 
bool getEnabled () const
 
double getFrequency () const
 
double getLast () const
 
double getTotal () const
 
double getOverhead () const
 
int getCount () const
 
const char * getName () const
 
int getSkip () const
 
bool getRunning () const
 
int getVerbose () const
 
const char * getValue (bool details=false, bool msonly=false)
 
void setVerbose (int v)
 
void start ()
 
void stop ()
 
void reset ()
 

Additional Inherited Members

- Static Public Member Functions inherited from InternalZGY::Timer
static void getValue_s (char *buf, int len, const char *name, int count, double total, bool running, bool details, bool msonly)
 

Detailed Description

Timer that prints its result when going out of scope.

Convenience class that stops (if needed) the timer and logs the result directly to stdout when the instance goes out of scope. Hopefully this is safe even when run at exit (e.g. in a static destructor) when the higher level logging mechanism or even iostreams might be shut down. Use for ad-hoc debugging only.

TODO-Low if PrintingTimer had taken a logger argument, there would be no need for this variant. On the other hand I would get a dependency to STL in this file.


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