diff --git a/lib/utils/file_util.dart b/lib/utils/file_util.dart index 5e908e7da..f3f2ec7fc 100644 --- a/lib/utils/file_util.dart +++ b/lib/utils/file_util.dart @@ -160,6 +160,7 @@ Future _downloadAndDecrypt(File file, BaseCacheManager cacheManager, final encryptedFile = io.File(encryptedFilePath); final decryptedFile = io.File(decryptedFilePath); + final startTime = DateTime.now().millisecondsSinceEpoch; return Dio() .download( file.getDownloadUrl(), @@ -175,6 +176,11 @@ Future _downloadAndDecrypt(File file, BaseCacheManager cacheManager, return null; } logger.info("File downloaded: " + file.uploadedFileID.toString()); + logger.info("Download speed: " + + (io.File(encryptedFilePath).lengthSync() / + (DateTime.now().millisecondsSinceEpoch - startTime)) + .toString() + + "kBps"); await CryptoUtil.decryptFile(encryptedFilePath, decryptedFilePath, Sodium.base642bin(file.fileDecryptionHeader), decryptFileKey(file)); logger.info("File decrypted: " + file.uploadedFileID.toString());