Changeset 7429 in josm
- Timestamp:
- 2014-08-17T12:25:09+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java
r7068 r7429 8 8 import org.openstreetmap.josm.data.coor.LatLonTest; 9 9 10 /** 11 * Checks that rounding of coordinates is not too slow. 12 */ 10 13 public class RoundingPerformanceTest { 11 14 12 15 private static double oldRoundToOsmPrecision(double value) { 13 return Math.round(value / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION; // Old method, causes rounding errors, but efficient 16 // Old method, causes rounding errors, but efficient 17 return Math.round(value / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION; 14 18 } 15 19 20 /** 21 * Checks that rounding of coordinates is not too slow. 22 */ 16 23 @Test 17 24 public void test() { … … 37 44 System.out.println("New time: "+newTime/1000000.0 + " ms"); 38 45 39 assertTrue(newTime <= oldTime*1 0);46 assertTrue(newTime <= oldTime*12); 40 47 } 41 48 }
Note:
See TracChangeset
for help on using the changeset viewer.