June 16
Sometimes you want to know is how long it has its own Java program. If one is satisfied with the indication of milliseconds, this is a couplet.
new Date ( ) ; Date start = new Date (); / / Do something . println ( "Anzahl Millisekunden: " System.out.println ("Number of milliseconds".. System . currentTimeMillis ( ) - start. getTime ( ) ) ; + (. System current time millis () - start getTime ().);
If you want to but at a slightly longer-term programs do not have to convert to hours and minutes, so it is somewhat difficult. What you get on the internet is not all for advice, making sure you do not reinvent the wheel. A look at the Apache Commons library helps here, as so often continue.
; org.apache.commons.lang.time.DurationFormatUtils import; ... new Date ( ) ; Date start = new Date (); / / Do something . println ( "Laufzeit: " System.out.println ("Term".. ( System . currentTimeMillis ( ) - start. getTime ( ) , "HH:mm:ss" ) ; . + DurationFormatUtils formatDuration (. System current time millis () - start getTime (), "hh: mm: ss.");



