Skip to content

Commit

Permalink
Fixed initalisation of globals polluting benchmarks
Browse files Browse the repository at this point in the history
The benchmarks were returning wrong numbers due to the first round of sampling requiring initialization of global/static variables in some functions.
  • Loading branch information
Jm15itch authored Jul 12, 2023
1 parent a9b7ace commit 849677e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,7 @@ void printAttrib(SDL_GLattr attr, char* name)
// Returns the processing time.
unsigned int BenchmarkFunction(void (*F)(), int samples)
{
(*F)(); // Preempt the function to skip initializations
unsigned int average = 0;
for (int i = 0; i < samples; i++)
{
Expand Down

0 comments on commit 849677e

Please sign in to comment.