I'm wondering if anyone has a good algorithm to work out average start time that handles times over midnight. Assume the job runs once every 24 hours and will usually start within a 6 hour window.
Obviously you could just sum seconds since midnight / number entries, which would work well if your times were:
11:00 and 13:00 where it would give the plausible 12:00
However...
23:00 and 01:00 would also give the answer 12:00 whereas 00:00 is desirable.
If, instead, you calculated this second example on seconds since 12:00 - you would get the desired answer of 00:00. But then the first example would also give you 00:00.
I'm thinking you could do it by doing a first pass to generate a histogram and then derive a good base time from that.
But I was hoping someone might already have implemented or know of a solution.
In reply to Average start time handling midnight by chrisjej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |