#include <boost/thread.hpp>
#include <boost/timer.hpp>
#include <iostream>

class Point {
public:
	Point(): x(0), y(0) {
	}
	void stepNorthEast() {
		x++;
		y++;
	}
	bool isNorthEast() {
		return x==y;
	}
private:
	int x, y;
};

class TestPoint {
private:
	Point p;
	void thread1() {
		for (int i(0); i < 20000000; i++)
			p.stepNorthEast();
	}
	void thread2() {
		for (int i(0); i < 20000000; i++)
			if (!p.isNorthEast())
				std::cout<<"Probleem!"<<std::endl;
	}
public:
	void test() {
		boost::timer t;
		boost::thread t1(&TestPoint::thread1, this); 
		boost::thread t2(&TestPoint::thread2, this); 
		t1.join();
		t2.join();
		std::cout<<t.elapsed()<<std::endl;
		std::cout<<"Einde."<<std::endl;
	}
};

int main() { 
	TestPoint tp;
	tp.test();
	std::cin.get();
	return 0; 
}