OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Classes | Namespaces
timer.h File Reference

Easy to use performance measurement. More...

#include "../declspec.h"

Go to the source code of this file.

Classes

class  InternalZGY::Timer
 
class  InternalZGY::PrintingTimer
 Timer that prints its result when going out of scope. More...
 
class  InternalZGY::RawPrintingTimer
 Timer that prints its result when going out of scope. More...
 
class  InternalZGY::SummaryTimer
 Hold the timing results from zero or more Timer instances. More...
 
class  InternalZGY::SummaryPrintingTimer
 SummaryTimer that prints its result when going out of scope. More...
 
class  InternalZGY::SimpleTimer
 Timer that knows where to store the result. More...
 

Namespaces

 InternalZGY
 Implementation not visible to clients.
 

Detailed Description

Easy to use performance measurement.

The Timer class is implemented using basic, old style techniques. The goal is to make it as safe as possible, usable also if the stop & print happens in a static destructor where stdio and (if using .NET) the CLR might be shut down.

It is also a goal to avoid as many includes as possible in the header file, so as to not introduce additional dependencies. There are a few enhancements that have been rejected because of this. I might need to revist those, though.

The SummaryTimer and derived classes loosen these requirements somewhat. A pimpl is used (since those classes are less likely to be performance critical) and atomics are used to make add() threadsafe.