Not a typo. Midnight is 00:00:00. If you adjust that in seconds, it’ll give you hh:mm:ss format for duration instead of just seconds.
- Get the current time.
- Upload a test file of known small-ish size to your final destination.
- Get current time.
- Calculate the time difference.
- Calculate the upload transfer rate.
- Get current time.
- Download the test file.
- Get the current time.
- Calculate the time difference.
- Calculate the download transfer rate.
- Remove the Test file from the destination.
- Get size of actual file to be uploaded/downloaded and retained.
- Calculate upload/download duration for actual file based on earlier rates.
Particular routers and firewalls may have options to maintain a throughput log, so if you were using something like pfSense, you might have some alternative options that you could base on historical data speeds if you could find a way to periodically generate a log and then aggregate the details to give you an idea of an estimated speed/data rate.