#include <stdio.h>
#include <time.h>
#define timefnrt(W, X, Z){\
	time_t V = time(NULL);\
	W = X;\
	time_t Y = time(NULL);\
	Z = difftime(Y, V);\
};
class foo {
public:
	int somefunc(int& x, int y) {
		for (int i = 0; i < x; i++)
			printf("Iteration %d\n", i);
		printf("Address of x within func is %p\n", &x);
		printf("Address of y within func is %p\n", &y);
		printf("Address of object within func is %p\n", this);
		return y;
	}
};
int main() {
	foo f;
	double ftime;
	int retval;
	int x = 2;
	int y = 30;
	printf("Address of x in main is %p\n", &x);
	printf("Address of y in main is %p\n", &y);
	printf("Address of object in main is %p\n", &f);
	printf("---\n");
	timefnrt(retval, f.somefunc(x, y), ftime);
	printf("Return value was %d, Time taken was %f seconds\n", retval, ftime);
	
}