Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2021-10-14 08:03:33

M2m
Member
Registered: 2021-02-18
Posts: 11

GBDK2020 - How to benchmark ?

Hi there,
whats the proper way to benchmark your code with GBDK2020 ?
I tried something similar as below, but it think the timing resolution is not high enough.

#include <time.h>

int main(void) {
  clock_t start_time = clock();

  // code or function to benchmark

   UINT16 elapsed_time = clock() - start_time;
  printf("Done in %d seconds\n", elapsed_time);
}

Any recommendation ?

Offline

 

#2 2021-10-15 09:34:07

toxa
Member
Registered: 2020-02-13
Posts: 267

Re: GBDK2020 - How to benchmark ?

yes.
1. can profile your code precisely with BGB, look into GBDK-2020 examples
2. with the help of profiler in Emulicious

Offline

 

#3 2021-10-16 00:18:23

M2m
Member
Registered: 2021-02-18
Posts: 11

Re: GBDK2020 - How to benchmark ?

toxa wrote:

yes.
1. can profile your code precisely with BGB, look into GBDK-2020 examples
2. with the help of profiler in Emulicious

Thanks. I'll give it a try,

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson