Timing question

Hi to all!

I'm using a Java class that factorize big integer into prime factors. I have to search in a 256 bits prime its about-160-bits factors. I use a Curve Elliptic method, that takes a long long time if the number is a product of two big (about 120) factors. As I only need to factorize numbers with bigg factors and as I do not want to modify the factorization class, is there a way to gain control of elapsed time of a method and interrupt it?

For example:

try{

// here there is my code

factorize(p);

}

catch (tooMuchTime foo){

}

Is there a way to do this?

Thanks

Alessio

[855 byte] By [bronze-starDukes] at [2007-11-26 12:11:21]
# 1
I think you are going to need to put it in a separate thread and start a timer that will interrupt it, if it doesn't finish in time.
silverstar at 2007-7-7 14:09:44 > top of Java-index,Archived Forums,Socket Programming...