E
Eric Lilja
Hello, I wrote a simple class that can measure the time it takes to
call a function using some platform dependent code. The actual
measurement function in this timer class has this signature:
typedef void (*FunctionPointer)(const long double *, const long double
*, std::size_t);
double TimerClass::time_function(FunctionPointer fptr, const long
double *x, const long double *y, std::size_t size)
The arguments following the function pointer is those that are to be
sent to the function that is measured...so this class is not reusable
at all, it only works for functions taking those arguments...can I do
some template magic here be able to use it with all functions, no
matter their argument lists? Or maybe something else?
- Eric
call a function using some platform dependent code. The actual
measurement function in this timer class has this signature:
typedef void (*FunctionPointer)(const long double *, const long double
*, std::size_t);
double TimerClass::time_function(FunctionPointer fptr, const long
double *x, const long double *y, std::size_t size)
The arguments following the function pointer is those that are to be
sent to the function that is measured...so this class is not reusable
at all, it only works for functions taking those arguments...can I do
some template magic here be able to use it with all functions, no
matter their argument lists? Or maybe something else?
- Eric