The Hero of Time Posted March 6, 2016 Share Posted March 6, 2016 6 Quote Link to comment Share on other sites More sharing options...
Salty as fuck Posted March 6, 2016 Share Posted March 6, 2016 (edited) you should definitely get a runtime set up in there public void onStart() { startTime = System.currentTimeMillis(); } public String format(long time) { StringBuilder string = new StringBuilder(); long totalSeconds = time / 1000L; long totalMinutes = totalSeconds / 60L; long totalHours = totalMinutes / 60L; int seconds = (int)totalSeconds % 60; int minutes = (int)totalMinutes % 60; int hours = (int)totalHours % 24; if (hours > 0) { string.append(hours + "h "); } if (minutes > 0) { string.append(minutes + "m "); } string.append(seconds +"s"); return string.toString(); } g.drawString("Runtime: " + format((System.currentTimeMillis()-startTime)), 555, 418); Edited March 6, 2016 by Reminiscence Quote Link to comment Share on other sites More sharing options...
Vilius Posted March 6, 2016 Share Posted March 6, 2016 so wet Quote Link to comment Share on other sites More sharing options...
The Hero of Time Posted March 6, 2016 Author Share Posted March 6, 2016 you should definitely get a runtime set up in there public void onStart() { startTime = System.currentTimeMillis(); } public String format(long time) { StringBuilder string = new StringBuilder(); long totalSeconds = time / 1000L; long totalMinutes = totalSeconds / 60L; long totalHours = totalMinutes / 60L; int seconds = (int)totalSeconds % 60; int minutes = (int)totalMinutes % 60; int hours = (int)totalHours % 24; if (hours > 0) { string.append(hours + "h "); } if (minutes > 0) { string.append(minutes + "m "); } string.append(seconds +"s"); return string.toString(); } g.drawString("Runtime: " + format((System.currentTimeMillis()-startTime)), 555, 418); true lmao, thanks :P Quote Link to comment Share on other sites More sharing options...
Krys Posted March 6, 2016 Share Posted March 6, 2016 nice Quote Link to comment Share on other sites More sharing options...
Salty as fuck Posted March 6, 2016 Share Posted March 6, 2016 true lmao, thanks np goodjob though Quote Link to comment Share on other sites More sharing options...
HanixD Posted March 6, 2016 Share Posted March 6, 2016 Nice one man Quote Link to comment Share on other sites More sharing options...
Realist Posted March 6, 2016 Share Posted March 6, 2016 :weekend: Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted March 6, 2016 Share Posted March 6, 2016 New SIII Incoming. Nice one! Quote Link to comment Share on other sites More sharing options...
Sky Posted March 6, 2016 Share Posted March 6, 2016 Nice work ^_^ Good luck with the rest of your work! Quote Link to comment Share on other sites More sharing options...
Botre Posted March 6, 2016 Share Posted March 6, 2016 Noice one buddy Quote Link to comment Share on other sites More sharing options...
lisabe96 Posted March 6, 2016 Share Posted March 6, 2016 (edited) you should definitely get a runtime set up in there public void onStart() { startTime = System.currentTimeMillis(); } public String format(long time) { StringBuilder string = new StringBuilder(); long totalSeconds = time / 1000L; long totalMinutes = totalSeconds / 60L; long totalHours = totalMinutes / 60L; int seconds = (int)totalSeconds % 60; int minutes = (int)totalMinutes % 60; int hours = (int)totalHours % 24; if (hours > 0) { string.append(hours + "h "); } if (minutes > 0) { string.append(minutes + "m "); } string.append(seconds +"s"); return string.toString(); } g.drawString("Runtime: " + format((System.currentTimeMillis()-startTime)), 555, 418); Or since it's skill training: formatTime(expTracker.getElapsed(Skill.WOODCUTTING)) And to format the time: public static String formatTime(long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } Edited March 6, 2016 by lisabe96 1 Quote Link to comment Share on other sites More sharing options...
Genii Posted March 6, 2016 Share Posted March 6, 2016 Safe Quote Link to comment Share on other sites More sharing options...
Epsilon Posted March 6, 2016 Share Posted March 6, 2016 lux gud soldier Quote Link to comment Share on other sites More sharing options...
Tom Posted March 6, 2016 Share Posted March 6, 2016 successful* Quote Link to comment Share on other sites More sharing options...