I have been wondering about this for some time, but is there anyway in C++ to time the length (in milli seconds, seconds etc) of your program. Working on some of the algorithms found in Project Euler, it wold be interesting I think to see if it's possible to make an algorithm quantifiably more efficient.
by using clock() you can store the time when you start in x. and if you're done you store clock() in another variable like y. with data type clock_t. but actually ill better show you this example: