[Game Thread, when to update FPS?] *solved*

Hello JGO :point:
Today I’ve been constructing a Game Loop so that I can calculate some statistics of it and such 8)

Information:
The Game Loop is a thread.

Game run method layout:


public void run() {
	/* Initialize Starting Times */
	while (!isDestroyed()) {
		/* Update Game Logic */
		update();
		/* Render */
		render();
		/* Send the thread to sleep ^_^, no calculations for it at the moment */
		sleep(10L, true);
		/* Calculate some statistics */
		debug();
	}
}

My Question is:
Where in my game thread would I call the ‘updateFPS()’ method?
Before sleeping?, before painting?, after painting?
I’ve never known this lol, and now that I’m constructing a good game thread I’d like to ^__^.

Any feedback would be helpful thanks :smiley:

Generally at the end of the loop, because it makes more sense. If you do everything, calculate the FPS, and do everything again, and calculate it again, it will keep a hopefully constant rate. Also, you would want to do it at the end because you’ll know how many frames of all the updating and rendering in a second.

Well thanks ago ^__^.
I always inserted the method to update @ the beginning :emo: