These are chat archives for anacrolix/torrent

12th
Mar 2018
deranjer
@deranjer
Mar 12 2018 03:04
@YouROK Basically I have an engine loop that is run every time the client asks for an update. When the client asks for the first update, the time (and downloaded bytes) is added to my database, then on the second update request, the old time (and downloaded bytes) and the new time (and downloaded bytes) are passed in, then a delta check is performed to get the amount of time (and bytes downloaded) between updates. I then calculate the speed based on time passed vs bytes downloaded, then convert bytes in MB (or KB) based on the amount of bytes.