Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Calendar c = Calendar.getInstance();
- c.setTimeInMillis(new Date().getTime() - gameStart.getTime());
- StringBuilder sb = new StringBuilder("Run time: ");
- if(c.get(Calendar.HOUR) != 0) {
- sb.append(c.get(Calendar.HOUR));
- sb.append(" hours ");
- }
- if(c.get(Calendar.MINUTE) != 0) {
- sb.append(c.get(Calendar.MINUTE));
- sb.append(" minutes ");
- }
- if(c.get(Calendar.SECOND) != 0) {
- sb.append(c.get(Calendar.SECOND));
- sb.append(" seconds ");
- }
- if(c.get(Calendar.MILLISECOND) != 0) {
- sb.append(c.get(Calendar.MILLISECOND));
- sb.append(" milliseconds");
- }
- Shocky.sendChannel(bot, channel, sb.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement