Originally posted by: SystemAdmin
[Strider said:]
[quote author=Didier Vidal link=topic=676.msg2061#msg2061 date=1226334118]
This post
http://forums.ilog.com/optimization/index.php?topic=267.msg710#msg710 should give you a solution if you use a version of CPLEX that doesn't have the method getCPLEXTime.
Didier.
They suggest System.currentTimeMillis().
If you want more accuracy I suggest using System.nanoTime() if you have JDK 1.5+. This is not mainly because it uses nanoseconds, but because the milliseconds from System.currentTimeMillis can be off by some amount. You could write something like this:
long beginTime = System.nanoTime();
cplex.solve();
long endTime = System.nanoTime();
System.out.println("Solution time = " + ((endTime - beginTime) / 1E6) + " ms.");
#CPLEXOptimizers#DecisionOptimization