/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;
import java.time.format.*;
import java.time.temporal.*;
import java.util.concurrent.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Instant start = Instant.now() ;
Instant stop = start.plusSeconds( TimeUnit.MINUTES.toSeconds( 7L ) ) ;
Duration duration = Duration.between( start , stop );
String outputStandard
= duration.
toString();
Duration duration2 = Duration.parse( outputStandard ); // Going the other direction, parsing string.
System.
out.
println( "Start/Stop: " + start
+ "/" + stop
); System.
out.
println( "outputStandard: " + outputStandard
); System.
out.
println( "duration2.toString(): " + duration2
);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgppbXBvcnQgamF2YS50aW1lLio7CmltcG9ydCBqYXZhLnRpbWUuZm9ybWF0Lio7CmltcG9ydCBqYXZhLnRpbWUudGVtcG9yYWwuKjsKaW1wb3J0IGphdmEudXRpbC5jb25jdXJyZW50Lio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoKSW5zdGFudCBzdGFydCA9IEluc3RhbnQubm93KCkgOwpJbnN0YW50IHN0b3AgPSBzdGFydC5wbHVzU2Vjb25kcyggVGltZVVuaXQuTUlOVVRFUy50b1NlY29uZHMoIDdMICkgKSA7CgpEdXJhdGlvbiBkdXJhdGlvbiA9IER1cmF0aW9uLmJldHdlZW4oIHN0YXJ0ICwgc3RvcCApOwoKU3RyaW5nIG91dHB1dFN0Y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