Answer the question
In order to leave comments, you need to log in
How to correctly evaluate the speed of work?
Hello, I wrote a program that processes data and issues it.
I want to calculate how much the program does per second and did this:
V = S / T
V - speed
S - number of results
T - time
The result is similar to the truth, but it shows me not the current speed, but let's say the average performance per second all the time, something similar to the arithmetic mean.
Is there an idea to do it like this
Once per second, subtract the current count from the past and that will be the speed?
I would like a solution without writing down history, but with some kind of formula.
Answer the question
In order to leave comments, you need to log in
The speed is not a constant value, but a dynamic one, you are right - in each section, for example, in 1s it can easily differ. In any case, you will have to store some kind of history or assemble aggregates in such a setting. It is fashionable to clear the history later, and leave the aggregates
There is a solution from computer graphics. You mark time before processing of one line of the data and after.
Let's say it took 100 ms for 1 line of data, now you divide 1000 ms by 100ms and you get a speed of 10 lines per second.
You can update the result once a second or less often.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question