Implemented fairly accurate FPS counter