Chambo Posted October 7, 2016 Posted October 7, 2016 Hey guys i'm feeling really stupid right now... lol I don't know if it's because i'm running on no sleep for the past almost 24 hours or what but i can't figure out how to calculate items per hour? I already have current clay mined with the variable xCount; and I have a current time running variable of timeRun; any help please? lol Thanks in advance!
Spookz Posted October 7, 2016 Posted October 7, 2016 you'd be more productive if you continued after a nice snooze :^) im helpang
Fishing Posted October 7, 2016 Posted October 7, 2016 (edited) This is what i use: itemsmadeperhour= (int)(itemsmade / ((System.currentTimeMillis() - this.timeBegan) / 3600000.0D)); And then just add this in paint: g.drawString("Items p/h: " + itemsMadePerHour, 1, 1); Edited October 7, 2016 by Stealth Quester 1
Abuse Posted October 7, 2016 Posted October 7, 2016 Logical walkthrough: Save time started startedAt = System.currentTimeMillis() Get Running time runTime = System.currentTimeMillis() - startedAt Convert runtime milliseconds to hours hoursRan = runTime / 3600000 Calculate per hour perHour = itemsMade / hoursRan 1