diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-06-15 18:43:25 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-06-15 18:43:25 -0600 |
commit | 8db9ccdf642ed81f585e900a843c411b973ce6da (patch) | |
tree | 54cac94efc109ec47a0111605dbbaae8c9d24fd0 /src/net/brysonsteck/Resurrection/player/TimeCheck.java | |
parent | 7d5f60d921cd35ce82a24e75ebfd79a3fd64bfed (diff) | |
download | resurrection-8db9ccdf642ed81f585e900a843c411b973ce6da.tar resurrection-8db9ccdf642ed81f585e900a843c411b973ce6da.tar.gz resurrection-8db9ccdf642ed81f585e900a843c411b973ce6da.tar.bz2 |
starting to test timer
Diffstat (limited to 'src/net/brysonsteck/Resurrection/player/TimeCheck.java')
-rw-r--r-- | src/net/brysonsteck/Resurrection/player/TimeCheck.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/net/brysonsteck/Resurrection/player/TimeCheck.java b/src/net/brysonsteck/Resurrection/player/TimeCheck.java new file mode 100644 index 0000000..f1cf004 --- /dev/null +++ b/src/net/brysonsteck/Resurrection/player/TimeCheck.java @@ -0,0 +1,20 @@ +package net.brysonsteck.Resurrection.player; + +import java.util.concurrent.TimeUnit; + +public class TimeCheck { + long millis; + + public TimeCheck(long millis) { + this.millis = millis; + } + + public String formatTime() { + String formattedTime = String.format("%d hrs, %d min, %d sec", + TimeUnit.MILLISECONDS.toHours(millis), + TimeUnit.MILLISECONDS.toMinutes(millis), + TimeUnit.MILLISECONDS.toSeconds(millis) - + TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))); + return formattedTime; + } +} |