see these ideology:
0 - we get the start time;
//on loop:
1 - we draw the things;
2 - we count the frames;
3 - we get the new time;
4 - if it's 1 second:
1 - we get the start time;
2 - we get\draw the frame count.
0:
1 2 3 4
LARGE_INTEGER timeStart;
LARGE_INTEGER timeEnd;
QueryPerformanceCounter(&timeStart);
int FrameCount=0;
1-now on loop the things...
2 : FrameCount++;
3: QueryPerformanceCounter(&timeEnd);
4:
but i belive that these calculation is wrong, because i used the MSIAfterburner program that give me 60fps instead my calculation: 30fps. https://imgur.com/a/awFcT
what i'm doing wrong?
Moderator: why the code button continues with a bug\error? everytime that i create the topic i can't use code button or i will get an error? https://imgur.com/a/ldvZF
because i'm using directx and maybe i need avoid windows messages for speed... i don't know. but now works fine: timeStart=static_cast <float> (clock ()) / static_cast <float> (CLOCKS_PER_SEC);
on loop: