You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2018/04/09 22:04:47 UTC
svn commit: r1828778 -
/pivot/trunk/core/test/org/apache/pivot/json/test/BindTest.java
Author: rwhitcomb
Date: Mon Apr 9 22:04:46 2018
New Revision: 1828778
URL: http://svn.apache.org/viewvc?rev=1828778&view=rev
Log:
PIVOT-960: Update the timing part of BindTest to report time in seconds,
not nanoseconds.
Modified:
pivot/trunk/core/test/org/apache/pivot/json/test/BindTest.java
Modified: pivot/trunk/core/test/org/apache/pivot/json/test/BindTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/test/org/apache/pivot/json/test/BindTest.java?rev=1828778&r1=1828777&r2=1828778&view=diff
==============================================================================
--- pivot/trunk/core/test/org/apache/pivot/json/test/BindTest.java (original)
+++ pivot/trunk/core/test/org/apache/pivot/json/test/BindTest.java Mon Apr 9 22:04:46 2018
@@ -63,6 +63,8 @@ public class BindTest {
private static final String A_B_C = "{a:1, b:2, c:'3'}";
private static final String FOO_A_B_C = "{foo: {a:1, b:2, c:'3'}}";
+ private static final double NANOS_PER_SEC = 1_000_000_000.0d;
+
/**
* Tests returning an untyped list.
*
@@ -271,8 +273,10 @@ public class BindTest {
long withMacrosTime = (end1 - start1);
long withoutMacrosTime = (end2 - start2);
+ double withMacrosSecs = (double) withMacrosTime / NANOS_PER_SEC;
+ double withoutMacrosSecs = (double) withoutMacrosTime / NANOS_PER_SEC;
// Just report the times, there is no right answer here
- System.out.format("Time with macro overhead = %1$,d nsecs; time without macros = %2$,d nsecs%n",
- withMacrosTime, withoutMacrosTime);
+ System.out.format("Time with macro overhead = %1$.6f secs; time without macros = %2$.6f secs%n",
+ withMacrosSecs, withoutMacrosSecs);
}
}