So to visualise the problem heres the mocked data that i use.
1s => 2840, 2s => 2042, 3s => 1106, 4s => 269, 5s => 409, 6s => 0, 7s => 449, 8s => 531, 9s => 910
What i would like to achieve is to get the time value (s) which applies to the all counts average, thats been weighted depending on the time and count.
As for simpler example to understand what i mean
1s => 10, 2s => 0, 3s => 10
The output would be 2s