Added TIMER class and object to avoid repeated code for counting frames and then perform actions. Added new sample