PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: raymw on January 31, 2017, 12:54:43 PM

Title: profiling
Post by: raymw on January 31, 2017, 12:54:43 PM
Not that I have any serious need at the moment, just curious. It used to be, back in the pre-windows days, that there was a simple way of timing how long code took to execute. iirc you started a timer, then ran a 'for next loop' for a few thousand times, and then ran another loop executing your code for the same number of iterations, then compared the timings and divided by the loop counter. Now, I guess with multi threaded processors, larger memory, the fact that windows often wanders off to play with the mouse, usb, whatever, that that method has no relevance. Some software tools for some development platforms have profilers, etc, but is their anything available (for free?) for firebird/freebasic? Any way of estimating time saved for various routines, and so on?.
Title: Re: profiling
Post by: Paul Squires on January 31, 2017, 04:01:28 PM
Do a search in the FB Help file for "Profiling" and you will find a nice writeup on the process for function profiling using GPROF.
Here is the same page from the FB Wiki:  http://www.freebasic.net/wiki/wikka.php?wakka=ProPgProfiling

To individual blocks of code you can use timers such as this great code by a fellow PB'er who is converting to FB: http://www.freebasic.net/forum/viewtopic.php?f=7&t=25363
Title: Re: profiling
Post by: raymw on January 31, 2017, 07:04:36 PM
I'll look at the links, thanks.

Apols for calling firefly as firebird - that's the brand name of my central heating boiler. Wait until I refer to either as firefox...