
Help me to analyse!!!
I'm developing some algorithms using java.math.BigInteger and java.math.BigDecimal classes, but I have to analyze, how many computer operation is done when I use methods of these classes. For example I want to add value of the two BigInteger obejcts like 1234567890123456789012345678901234567890 and 9876543210987654321098765432109876543210 using BigInteger's add() method, so how many elementary computation is done to give me output? Or say in different how long does add() method takes, on computer with 1.000.000 elementary operations per second, to add those BigIntegers?

You want to know the time taken to do this, or how many operations take place in that calculation?
Do you know anything about Z80 or something low level language?

Eranga, I do not know about Z80 low language. I need to know how many operations take place in that calculation. Can you advise me? I need result with equation, which include parameters of computer's frequency.

So you can think about the number of iteration you take to calculate those numbers, just buildup the logic first and added into an equation.

So I wrote program:
import java.math.BigDecimal;
class Sqrt {
BigDecimal sqrt2() {
BigDecimal x = new BigDecimal("1");
BigDecimal a = new BigDecimal("0");
BigDecimal ikki = new BigDecimal("2");
BigDecimal yarim = new BigDecimal("0.5");
for (int i=0; i<=7; i++) {
a=ikki.divide(x, 300, 0);
x=x.add(a);
x=x.multiply(yarim);
}
return x;
}
}
class SquareRoot {
public static void main(String args[]) {
Sqrt sqrt = new Sqrt();
System.out.println(sqrt.sqrt2());
}
}
Look at
a=ikki.divide(x, 300, 0);
x=x.add(a);
x=x.multiply(yarim);
I do not know how many operations ,for example, in method add(), because it's different simple plus (+). What do you think?
I don't need this (the fragment gives result how many time program worked):
long t1 = System.currentTimeMillis();
x=x.add(a);
long time = System.currentTimeMillis()  t1;
Sorry for my poor english...

Nobody wants to help me... :(

Olim:
What you are looking for is the number of machine cycles for each command? Part of what your looking for is the assembler commands (low lelvel) equivalent of those operations (try Google). You are correct in stating that System.currentTimeMillis() is not what you are looking for. The only thing I can think of is using a dissambler. DOS comes with one (not in the help) called "debug" , but I used so long ago, I have forgotten what it all does (again try Google with "DOS debug commands"). But to understand what your looking for you would have to understand the assembler language.
Luck,
CJSL