diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-01-09 23:08:23 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-01-09 23:08:23 -0500 |
commit | 3a7a77d49e620420ee33996eec0a70a7c186f6bb (patch) | |
tree | d540c997551dbbf7f334de15ffb6f5daacb95987 /klippy/msgproto.py | |
parent | c87c090264fb9fd91bc87fbc63a05c5e53e3c484 (diff) | |
download | kutter-3a7a77d49e620420ee33996eec0a70a7c186f6bb.tar.gz kutter-3a7a77d49e620420ee33996eec0a70a7c186f6bb.tar.xz kutter-3a7a77d49e620420ee33996eec0a70a7c186f6bb.zip |
basecmd: Improve accuracy of stats "sumsq" variable
Use a base of 256 instead of 65536 when calculating the sum of the
square of the clock differences in the stats. This makes the
calculation more accurate. Export the new base via DECL_CONSTANT for
the host to access. Use DIV_ROUND_UP() when adjusting for the base to
ensure no lost ticks. Do the division after multiplication in the
common case where the time between stats_task() invocations is less
than 64K ticks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/msgproto.py')
0 files changed, 0 insertions, 0 deletions