Le 17/05/2012 19:57, Emil Lenngren a écrit :
> What exactly were the problems, how far did you come?
>
> Maybe add an instruction in the compiled code that is inserted in the
> beginning of each function, when a (new) profiling compilation flag is
> active.
> When that instruction is executed, a counter that counts how many time that
> function is incremented. Also one instruction can be inserted just before
> Return. Then the running time can be measured. (Exceptions must also be
> considerated...)
> Gprof uses a similar method.
>
> Or skip new instructions and implement it directly in the interpreter "if
> (profiling_active) ...", but that extra if-statement might slow down the
> execution when profiling is not active...
>
> There are surely more ways to implement it ;)
>
> /Emil
>

I wanted to use setitimer() and note which function we are executing 
each microsecond (for example).

The other solution (yours) seems to be better. I'd like to note the time 
spent in each line too, it may be useful. I will see!

By the way, don't you have something to show us?

-- 
Benoît Minisini

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to