Log in

View Full Version : Runs per hour



sm0k3
04-18-2011, 09:23 PM
Could somone make mea runs per hour function that returns the current runs per hour calculated from runs currently done an hour .. :)
i am rubbish with maths .. can work it out . :)

HarryJames
04-18-2011, 09:33 PM
function xPerHour(what:Integer) : Integer
begin
result := Round(3600 * what / (GetTimeRunning div 1000 + 1));
end;

Should do the job :)

Troll
04-18-2011, 09:34 PM
Function(TimeRunning,Runs:Integer):Integer;
Begin
Result := ((60/TimeRunning)*Runs);
End;


Just did in my head but should work, not so sure about compile though

E: no as it wont all ways be integers, other then that works, plus i got ninjaed

Richard
04-18-2011, 11:48 PM
Speed = Distance / Time. Very simple equation that can be applied to anything with a rate :)

So, amount of things done, divided by the amount of hours.

perHour := (thingsDone/(timeInMs * 3600 * 1000));

HarryJames
05-10-2011, 01:08 AM
http://villavu.com/forum/showpost.php?p=800162&postcount=2

Edit - double ninja'd. Silly iPod touch making mw really slow at doing anything!