Contempt+ wrote: |
I was gonna start working on that one soon. Just gotta get around to doing it. I've got a lot of other stuff I'm working on at the same time, so I don't have the time to do it, lol. |
Quote: |
public static long currentTimeMillis()
Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC). |
Code: Show/Hide long lngStart = System.currentTimeMillis(); public long getUptime() { return System.currentTimeMillis() - lngStart; } |
Code: Show/Hide long startTime = System.currentTimeMillis(); .......................................... .......................................... public void buptime(String name, String msg){ long difference = System.currentTimeMillis() - startTime; int days = (int)(Math.floor(difference/1000/60/60/24)); int hours = (int)(Math.round( (difference/60/60 % 24000)/1000)); int minutes = (int)Math.round( (difference/60 % 60000)/1000 ); int seconds = (int)Math.round( (difference % 60000)/1000 ); m_botAction.sendPrivateMessage( name, "Bot has been up for " + days + " day(s) " + hours + " hour(s) " + minutes + " minute(s) and " + seconds + " second(s)." ); } |
Cerium wrote: |
Im kind of suprised ekted hasnt thrown up on his keyboard and posted something explaining how he was daming your name while cleaning it up. |
Code: Show/Hide // this is inferior code
for (i = 0; i < size; i++) { a = array + i; // do something with a } // this is much better a = array; for (i = 0; i < size; i++) { // do something with a a++; } |
Ekted wrote: |
For example, if I'm multiplying by 4 because that is the formula for something, I prefer to use "* 4" in the code instead of "<< 2". |