|
#ifndef _CELERO_UTILITIES_H_
#define _CELERO_UTILITIES_H_
namespace celero
{
///
/// \func DoNotOptimizeAway
///
/// From Andrei Alexandrescu
///
template<class T> void DoNotOptimizeAway(T&& datum)
{
#ifdef WIN32
if(_getpid() == 1)
#else
if(getpid() == 1)
#endif
{
const void* p = &datum;
putchar(*static_cast<const char*>(p));
}
}
///
/// Quick definition of the number of microseconds per second.
///
const auto UsPerSec(1000000.0);
///
/// Define the number of samples to default to for a good stastical sample when automatically timing tests.
///
const auto StatisticalSample(30);
}
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
John Farrier is a professional C++ software engineer that specializes in modeling, simulation, and architecture development.
Specialties:
LVC Modeling & Simulation
Software Engineering, C++11, C++98, C, C#, FORTRAN, Python
Software Performance Optimization
Software Requirements Development
Technical Project and Team Leadership