Ta ltc detect fps

this looks totally stupid: it seems that you're checking the gap every five seconds. You shoud check every second and after five bad gap you should update the value. Write at least comment so we can understand what you want to do.
_oldLastFrame seems also totally useless.