Index: lutinmatrix/src/test/org/codelutin/math/matrix/BasicMatrixTest.java diff -u lutinmatrix/src/test/org/codelutin/math/matrix/BasicMatrixTest.java:1.7 lutinmatrix/src/test/org/codelutin/math/matrix/BasicMatrixTest.java:1.8 --- lutinmatrix/src/test/org/codelutin/math/matrix/BasicMatrixTest.java:1.7 Thu Jun 1 17:38:56 2006 +++ lutinmatrix/src/test/org/codelutin/math/matrix/BasicMatrixTest.java Tue Sep 5 12:24:32 2006 @@ -23,16 +23,19 @@ * Created: 27 oct. 2004 * * @author Benjamin Poussin - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * - * Mise a jour: $Date: 2006/06/01 17:38:56 $ - * par : $Author: ruchaud $ + * Mise a jour: $Date: 2006/09/05 12:24:32 $ + * par : $Author: bpoussin $ */ package org.codelutin.math.matrix; import java.util.Arrays; import java.util.NoSuchElementException; + +import org.apache.commons.lang.time.DurationFormatUtils; + import junit.framework.TestCase; public class BasicMatrixTest extends TestCase { // BasicMatrixTest @@ -229,7 +232,7 @@ BasicMatrix m1 = new BasicMatrix(getFactory(), new int[]{30,30,30,30}); m1.map(f); long time1 = System.nanoTime(); - System.out.println("testPerfLineaire: " + (time1 - time)); + System.out.println("testPerfLineaire: " + DurationFormatUtils.formatDuration((time1 - time)/1000000, "s'.'S")); } public void testPerfCoordonnee() throws Exception { @@ -241,18 +244,18 @@ inc.setValue(inc.getValue() + 2); } long time1 = System.nanoTime(); - System.out.println("testPerfCoordonnee: " + (time1 - time)); + System.out.println("testPerfCoordonnee iter: " + DurationFormatUtils.formatDuration((time1 - time)/1000000, "s'.'S")); inc = m2.iterator(); while(inc.next()){ inc.setValue(inc.getValue() + 2); } long time2 = System.nanoTime(); - System.out.println("testPerfCoordonnee re: " + (time2 - time1)); + System.out.println("testPerfCoordonnee iter: " + DurationFormatUtils.formatDuration((time2 - time1)/1000000, "s'.'S")); m2.map(f); long time3 = System.nanoTime(); - System.out.println("testPerfLineaire: " + (time3 - time2)); + System.out.println("testPerfLineaire map: " + DurationFormatUtils.formatDuration((time3 - time2)/1000000, "s'.'S")); } @@ -265,19 +268,19 @@ inc.setValue(inc.getValue() + 2); } long time1 = System.nanoTime(); - System.out.println("testPerfCoordonnee2: " + (time1 - time)); + System.out.println("testPerfCoordonnee2: " + DurationFormatUtils.formatDuration((time1 - time)/1000000, "s'.'S")); inc = m2.iterator(); while(inc.next() && inc.next()){ inc.setValue(inc.getValue() + 2); } long time2 = System.nanoTime(); - System.out.println("testPerfCoordonnee2 re: " + (time2 - time1)); + System.out.println("testPerfCoordonnee2 re: " + DurationFormatUtils.formatDuration((time2 - time1)/1000000, "s'.'S")); m2.map(f); long time3 = System.nanoTime(); - System.out.println("testPerfLineaire2: " + (time3 - time2)); + System.out.println("testPerfLineaire2: " + DurationFormatUtils.formatDuration((time3 - time2)/1000000, "s'.'S")); } @@ -290,19 +293,19 @@ inc.setValue(inc.getValue() + 2); } long time1 = System.nanoTime(); - System.out.println("testPerfCoordonnee4: " + (time1 - time)); + System.out.println("testPerfCoordonnee4: " + DurationFormatUtils.formatDuration((time1 - time)/1000000, "s'.'S")); inc = m2.iterator(); while(inc.next() && inc.next() && inc.next() && inc.next()){ inc.setValue(inc.getValue() + 2); } long time2 = System.nanoTime(); - System.out.println("testPerfCoordonnee4 re: " + (time2 - time1)); + System.out.println("testPerfCoordonnee4 re: " + DurationFormatUtils.formatDuration((time2 - time1)/1000000, "s'.'S")); m2.map(f); long time3 = System.nanoTime(); - System.out.println("testPerfLineaire4: " + (time3 - time2)); + System.out.println("testPerfLineaire4: " + DurationFormatUtils.formatDuration((time3 - time2)/1000000, "s'.'S")); }