OpenImageIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
timer.h File Reference

Simple timer class. More...

#include "version.h"
#include <sys/time.h>
#include <cstdlib>

Go to the source code of this file.

Classes

class  ScopedTimer< TIMER >
 

Functions

template<class FUNC >
double time_trial (FUNC func, int n=1, double *range=NULL)
 

Variables

 OIIO_NAMESPACE_ENTER
 

Detailed Description

Simple timer class.

Function Documentation

template<class FUNC >
double time_trial ( FUNC  func,
int  n = 1,
double *  range = NULL 
)

Helper template that runs a function (or functor) n times, using a Timer to benchmark the results, and returning the fastest trial. If 'range' is non-NULL, the range (max-min) of the various time trials will be stored there.