package org.jenkinsci.plugins.p4.tasks; import java.util.Date; import java.util.concurrent.TimeUnit; public class TimeTask { long start; public TimeTask() { start = new Date().getTime(); } private long getDuration() { long stop = new Date().getTime(); return stop - start; } public String toString() { if (start == 0) { return "Timer not started"; } long ms = getDuration(); if (ms < 1000) { return "(" + ms + "ms)"; } long mins = TimeUnit.MILLISECONDS.toMinutes(ms); ms -= TimeUnit.MINUTES.toMillis(mins); long secs = TimeUnit.MILLISECONDS.toSeconds(ms); return mins + "m " + secs + "s"; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 11337 | Paul Allen | Merge down latest changes from MAIN | ||
//guest/paul_allen/dev/p4-jenkins/ublox/src/main/java/org/jenkinsci/plugins/p4/TimeTask.java | |||||
#1 | 11053 | Paul Allen | Branching using p4-jenkins | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/TimeTask.java | |||||
#1 | 10939 | Paul Allen |
Tidy up changes. - Moved duration timings to ClientHelper and measure each task individually. - White space/formatting on P4ChangeEntry. - Temporarily backed-out p4-plugin.properties file (could damage builds - need to understand requirements) |