Changeset 15755 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2020-01-23T22:57:46+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
r15719 r15755 42 42 import org.openstreetmap.josm.tools.ImageProvider; 43 43 import org.openstreetmap.josm.tools.Logging; 44 import org.openstreetmap.josm.tools.Stopwatch; 44 45 import org.openstreetmap.josm.tools.Utils; 45 46 … … 150 151 private static class MeasurableTask extends Task { 151 152 private final String name; 152 private final long start;153 private final Stopwatch stopwatch; 153 154 private String duration = ""; 154 155 155 156 MeasurableTask(String name) { 156 157 this.name = name; 157 this.st art = System.currentTimeMillis();158 this.stopwatch = Stopwatch.createStarted(); 158 159 } 159 160 … … 162 163 throw new IllegalStateException("This task has already been finished: " + name); 163 164 } 164 long time = System.currentTimeMillis() - start; 165 if (time >= 0) { 166 duration = tr(" ({0})", Utils.getDurationString(time)); 165 if (stopwatch.elapsed() >= 0) { 166 duration = tr(" ({0})", stopwatch); 167 167 } 168 168 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r15606 r15755 58 58 import org.openstreetmap.josm.tools.JosmRuntimeException; 59 59 import org.openstreetmap.josm.tools.Logging; 60 import org.openstreetmap.josm.tools.Stopwatch; 60 61 import org.openstreetmap.josm.tools.Utils; 61 62 … … 420 421 public void drawAll(Graphics2D g, MapView mv, List<WayPoint> visibleSegments, Bounds clipBounds) { 421 422 422 final long timeStart = System.currentTimeMillis();423 final Stopwatch stopwatch = Stopwatch.createStarted(); 423 424 424 425 checkCache(); … … 487 488 // show some debug info 488 489 if (Logging.isDebugEnabled() && !visibleSegments.isEmpty()) { 489 final long timeDiff = System.currentTimeMillis() - timeStart;490 491 490 Logging.debug("gpxdraw::draw takes " + 492 Utils.getDurationString(timeDiff)+491 stopwatch + 493 492 "(" + 494 493 "segments= " + visibleSegments.size() + 495 ", per 10000 = " + Utils.getDurationString(10_000 * timeDiff/ visibleSegments.size()) +494 ", per 10000 = " + Utils.getDurationString(10_000 * stopwatch.elapsed() / visibleSegments.size()) + 496 495 ")" 497 496 ); -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r15717 r15755 29 29 import org.openstreetmap.josm.tools.ListenerList; 30 30 import org.openstreetmap.josm.tools.Logging; 31 import org.openstreetmap.josm.tools.Stopwatch; 31 32 import org.openstreetmap.josm.tools.Utils; 32 33 … … 321 322 322 323 private static void loadStyleForFirstTime(StyleSource source) { 323 final long startTime = System.currentTimeMillis();324 final Stopwatch stopwatch = Stopwatch.createStarted(); 324 325 source.loadStyleSource(); 325 326 if (Config.getPref().getBoolean("mappaint.auto_reload_local_styles", true) && source.isLocal()) { … … 331 332 } 332 333 if (Logging.isDebugEnabled() || !source.isValid()) { 333 final long elapsedTime = System.currentTimeMillis() - startTime; 334 String message = "Initializing map style " + source.url + " completed in " + Utils.getDurationString(elapsedTime); 334 String message = "Initializing map style " + source.url + " completed in " + stopwatch; 335 335 if (!source.isValid()) { 336 336 Logging.warn(message + " (" + source.getErrors().size() + " errors, " + source.getWarnings().size() + " warnings)"); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
r15072 r15755 47 47 import org.openstreetmap.josm.tools.I18n; 48 48 import org.openstreetmap.josm.tools.Logging; 49 import org.openstreetmap.josm.tools.Stopwatch; 49 50 import org.openstreetmap.josm.tools.Utils; 50 51 import org.openstreetmap.josm.tools.XmlObjectParser; … … 353 354 Collection<TaggingPreset> tp; 354 355 Logging.debug("Reading presets from {0}", source); 355 long startTime = System.currentTimeMillis();356 Stopwatch stopwatch = Stopwatch.createStarted(); 356 357 try ( 357 358 CachedFile cf = new CachedFile(source).setHttpAccept(PRESET_MIME_TYPES); … … 368 369 } 369 370 if (Logging.isDebugEnabled()) { 370 Logging.debug("Presets read in {0}", Utils.getDurationString(System.currentTimeMillis() - startTime));371 Logging.debug("Presets read in {0}", stopwatch); 371 372 } 372 373 return tp;
Note:
See TracChangeset
for help on using the changeset viewer.