BlitzMax Profiler

When I test a program I usually use debuglog or my own ‘logprint’ function – that saves information in a txt file and so I can check it later, for errors or other things.

It works and the main advantage is to have a ‘storic’ of what the program did.

But sometimes I need a ‘real time’ check and something ‘more’ specific and automatic: I could fill my source-code of ‘LogPrint variabile’ in any point or any function and then read it later.

But surely, it’s not so handy.

So I started a little ‘profiler’ for BlitzMax.

Of course it’s very simple, no deep memory reading or other things you could usually find in professional IDE or compiler.

Basically it works in this way:

  • register a variable you want to track, giving it a name – unique – the frequency of record (the delay between a record and the next one in millisecs) – and the kind of type (INT, FLOAT, DOUBLE etc)
  • you can pause or resume or stop the ‘recorder’, show or read and save what you want.

At the moment I made a pre-alfa version (see the example below) and it seems to ‘works’: it registers the values (at the moment I recorded two variables – MOUSE_X and MOUSE_Y) and I can see them (pressing mouse botton 2).

I suspect there will be some time-error (all the things of recording ‘eats’ time) – but for the first step I think it’s quite good.

Next move: ‘recording’ objects – I presume I will use reflections to do this.

The ‘Draw’ function to show the data on screen is just a simple experiment: it needs more work to ‘scale’ and to represent different values and different variables.

Same for the other ‘Show’ functions: just to see if it works!

More to come.

 

 

local_offerevent_note August 20, 2017

account_box degac


local_offer

Leave a Reply

Your email address will not be published.