Re: exectution speed and debugging output
On Apr 1, 10:17 pm, Giff <giffn...@gmail.com.invalid> wrote:
Scott McPhillips [MVP] ha scritto:
User interactions are required to occur in milliseconds. 'if'
operations occur in nanoseconds. So you're not wrong, only a factor of
a million or so from being relevant.
:)
somehow I thought that that bool would have been set at runtime, but it
isn't, silly me
But it is, normally. Somewhere at the beginning of the program,
you will test if the option -D has been given, or if some
specific environment variable has been set, or in larger
projects, read a configuration file. And it is important that
the condition be relatively rapid if tracing is turned off (and
there is no user output). Relatively---you're still doing a lot
of other things in the code. So, for example, my code can even
support multiple if's in a single trace statement, but it would
not be acceptable to format the complete output into a string,
and just not write it.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34