I'm not sure how you'd use this code, as it seems incomplete. For example, I don't see any reset of the ticks value. I'd suggest putting together an SSCCE
that demonstrates exactly how it would be used, if you really want useful replies.
But by introducing threading, you're introducing uncertainty into your fps count. For example, it's theoretically possible for this thread to return from the Thread.sleep() call, but not actually get control until much later. That probably
won't happen, but you will see some wiggle in your data because of that problem.