http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx
#if defined(unix) || defined(__APPLE__)
# include <sys/time.h>
# include <sys/resource.h>
#if defined(unix) || defined(__APPLE__)
# include <sys/time.h>
# include <sys/resource.h>
# include <windows.h>
#endif
# include <windows.h>
#endif
#define clitkDD_h
#include <iostream>
#define clitkDD_h
#include <iostream>
# include <windows.h>
#endif
// David's debug
# include <windows.h>
#endif
// David's debug
# define DD(a) { \
std::ostringstream ossDD; \
ossDD << #a " = [ " << a << " ]" << std::endl; \
# define DD(a) { \
std::ostringstream ossDD; \
ossDD << #a " = [ " << a << " ]" << std::endl; \
===========================================================================**/
#ifndef CLITKPORTABILITY_H
#define CLITKPORTABILITY_H
===========================================================================**/
#ifndef CLITKPORTABILITY_H
#define CLITKPORTABILITY_H
# define _USE_MATH_DEFINES //Before math.h include (i.e. cmath)
#endif
#include <cmath>
# define _USE_MATH_DEFINES //Before math.h include (i.e. cmath)
#endif
#include <cmath>
# define rint(x) floor(x+0.5)
# define lrint(x) (long)rint(x)
#endif
# define rint(x) floor(x+0.5)
# define lrint(x) (long)rint(x)
#endif
clitk::Timer::Timer()
{
Reset();
clitk::Timer::Timer()
{
Reset();
QueryPerformanceFrequency((LARGE_INTEGER*)&mFrequency);
#endif
}
QueryPerformanceFrequency((LARGE_INTEGER*)&mFrequency);
#endif
}
{
#if defined(unix) || defined(__APPLE__)
getrusage(RUSAGE_SELF, &mBegin);
{
#if defined(unix) || defined(__APPLE__)
getrusage(RUSAGE_SELF, &mBegin);
QueryPerformanceCounter((LARGE_INTEGER*)&mBegin);
#endif
mNumberOfCall++;
QueryPerformanceCounter((LARGE_INTEGER*)&mBegin);
#endif
mNumberOfCall++;
mElapsed += (mEnd.ru_utime.tv_usec - mBegin.ru_utime.tv_usec)+
(mEnd.ru_utime.tv_sec - mBegin.ru_utime.tv_sec)*1000000;
}
mElapsed += (mEnd.ru_utime.tv_usec - mBegin.ru_utime.tv_usec)+
(mEnd.ru_utime.tv_sec - mBegin.ru_utime.tv_sec)*1000000;
}
QueryPerformanceCounter((LARGE_INTEGER*)&mEnd);
if (accumulate) {
mElapsed += ((mEnd-mBegin)*1000000)/(long double)mFrequency;
QueryPerformanceCounter((LARGE_INTEGER*)&mEnd);
if (accumulate) {
mElapsed += ((mEnd-mBegin)*1000000)/(long double)mFrequency;
#if defined(unix) || defined(__APPLE__)
# include <sys/time.h>
# include <sys/resource.h>
#if defined(unix) || defined(__APPLE__)
# include <sys/time.h>
# include <sys/resource.h>
# include <windows.h>
#endif
#include <iostream>
# include <windows.h>
#endif
#include <iostream>
#if defined(unix) || defined(__APPLE__)
rusage mBegin;
rusage mEnd;
#if defined(unix) || defined(__APPLE__)
rusage mBegin;
rusage mEnd;
unsigned __int64 mBegin;
unsigned __int64 mEnd;
unsigned __int64 mFrequency;
unsigned __int64 mBegin;
unsigned __int64 mEnd;
unsigned __int64 mFrequency;