Use MILLISECOND, not TIME$. Subtract the current MILLISECOND from the previous MILLISECOND, divide it by a thousand, then put that all under 1 and you will get your FPS.