Unverified Commit 5180201f authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[flutter_tool] Track APK sha calculation time (#33923)

parent b3382b99
...@@ -61,7 +61,14 @@ String hex(List<int> bytes) { ...@@ -61,7 +61,14 @@ String hex(List<int> bytes) {
} }
String calculateSha(File file) { String calculateSha(File file) {
return hex(sha1.convert(file.readAsBytesSync()).bytes); final Stopwatch stopwatch = Stopwatch()..start();
final List<int> bytes = file.readAsBytesSync();
printTrace('calculateSha: reading file took ${stopwatch.elapsedMicroseconds}us');
stopwatch.reset();
final String sha = hex(sha1.convert(bytes).bytes);
stopwatch.stop();
printTrace('calculateSha: computing sha took ${stopwatch.elapsedMicroseconds}us');
return sha;
} }
/// Convert `foo_bar` to `fooBar`. /// Convert `foo_bar` to `fooBar`.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment