J
junaidnaseer
Is it possible to actually count the number of addition or
multiplication operations performed in a program during runtime . I
know of a program that does this simply by looking through the code for
* and + operators but the problem is that this program is fooled when
we use if...else structures coz there might be a + in the if part but
the if part of the statement might not be getting actually called in a
particular execution of the program . here is a sample
if ( x==0)
y=y+1;
else
y=y+2;
now upon execution only one plus is executed but the code parsing
technique would give an answer of two which is wrong . I know there is
a way to actually count the number of operations performed during
runtime but i dont quite know how . I have to get this info to some one
else urgent so any one who knows about this plz help !
multiplication operations performed in a program during runtime . I
know of a program that does this simply by looking through the code for
* and + operators but the problem is that this program is fooled when
we use if...else structures coz there might be a + in the if part but
the if part of the statement might not be getting actually called in a
particular execution of the program . here is a sample
if ( x==0)
y=y+1;
else
y=y+2;
now upon execution only one plus is executed but the code parsing
technique would give an answer of two which is wrong . I know there is
a way to actually count the number of operations performed during
runtime but i dont quite know how . I have to get this info to some one
else urgent so any one who knows about this plz help !